Free Internal Link Checker with HTTP Response Status Codes
Easily analyze all internal links on any webpage using this free JavaScript-based internal link checker tool. This Chrome console script scans links pointing to the same domain and verifies their exact HTTP response status codes, helping you detect broken links, redirects, and server errors instantly.
This tool is ideal for SEO audits, technical website analysis, and debugging internal linking issues without relying on third-party crawlers.
How to Use This Tool
The Chrome Console Script for Internal Links
- Open the website you want to test in Google Chrome.
- Press
F12(orCmd + Option + Ion Mac) or Ctrl + Shift + I (or Right Click → Inspect) and switch to the Console tab. - Paste this code and press Enter:
(async () => {
console.log("%c🔍 Scanning Internal Links...", "color: #4f46e5; font-weight: bold; font-size: 14px;");
const currentHost = window.location.host;
const currentProtocol = window.location.protocol;
// 1. Gather all anchor tags on the page
const allLinks = Array.from(document.querySelectorAll('a[href]'));
const internalLinks = [];
const seenUrls = new Set();
allLinks.forEach(link => {
try {
// Resolve relative URLs to absolute URLs automatically
const url = new URL(link.href, window.location.origin);
// Filter: Must match current domain, must be http/https, ignore page hashes/anchors (#)
if (url.host === currentHost &&
(url.protocol === 'http:' || url.protocol === 'https:') &&
!seenUrls.has(url.origin + url.pathname + url.search)) {
const cleanUrl = url.origin + url.pathname + url.search;
seenUrls.add(cleanUrl);
internalLinks.push({
anchorText: link.textContent.trim() || '[No Anchor Text]',
url: cleanUrl
});
}
} catch (e) {
// Skip invalid or unparseable URLs
}
});
if (internalLinks.length === 0) {
console.log("✅ No internal links found on this page.");
return;
}
console.log(`📊 Found ${internalLinks.length} unique internal URLs. Pinging URLs for status codes...`);
// 2. Fetch status codes asynchronously
const results = [];
for (const item of internalLinks) {
try {
// Using standard GET or HEAD to check internal paths
const response = await fetch(item.url, { method: 'GET' });
results.push({
"Anchor Text": item.anchorText,
"Internal URL": item.url,
"Status": response.status,
"Status Text": response.statusText || (response.status === 200 ? "OK" : "")
});
} catch (error) {
results.push({
"Anchor Text": item.anchorText,
"Internal URL": item.url,
"Status": "FAILED / BLOCKED",
"Status Text": "Network Error"
});
}
}
// 3. Separate clean links from broken/redirected links for easier analysis
console.log("%c📋 All Internal Links Results:", "color: #10b981; font-weight: bold; font-size: 14px;");
console.table(results);
const brokenLinks = results.filter(r => r.Status === 404);
if (brokenLinks.length > 0) {
console.log("%c🚨 CRITICAL: Found 404 Broken Internal Links!", "color: #ef4444; font-weight: bold; font-size: 14px;");
console.table(brokenLinks);
} else {
console.log("%c🎉 Clean Sweep! No 404 internal links detected on this page view.", "color: #10b981; font-weight: bold;");
}
})();
What This Script Does
Extracts all internal links (same domain). Removes duplicate URLs. Sends HTTP HEAD requests. Returns actual status codes (200, 301, 404, 500, etc.). Displays results in a clean console table.
Why Internal Link Checking is Important
Internal links are critical for website structure, SEO performance, and user navigation. Broken internal links can negatively affect search engine crawling and reduce user trust.
By auditing internal links, you can:
- Identify broken pages (404 errors)
- Detect redirect chains (301/302)
- Improve crawl efficiency
- Strengthen site architecture
- Enhance user experience