Accessibility / URLs Links / Check Links

The Check Links bookmarklet validates all links on the page by fetching their URLs. Finds all anchor links (excluding mailto: and javascript:), tests each link with HTTP HEAD requests, colors links green (OK), red (broken/404), or orange (redirect/error), shows a progress indicator during testing, and displays a modal with full results when complete. Includes retry logic for network failures. Useful for identifying broken links and HTTP errors.

WCAG SC 2.4.4: Link Purpose
Run Check Links

Test run or drag to
bookmarklets bar to install

javascript:%21function()%7Bfunction%20e(e)%7Bdocument.body.removeChild(e)%7Dfunction%20t(e%2Cn%2Cr%3D2)%7Bn.style.color%3D%22gray%22%2Cfetch(e%2C%7Bmethod%3A%22HEAD%22%2Credirect%3A%22manual%22%7D).then(t%3D%3E%7Bt.ok%3F(c.push(%60%24%7Be%7D%20is%20OK%20(%24%7Bt.status%7D)%60)%2Cn.style.color%3D%22green%22)%3A404%3D%3D%3Dt.status%3F(c.push(%60%24%7Be%7D%20is%20broken%20(404)%60)%2Cn.style.color%3D%22red%22)%3At.status%3E%3D300%26%26t.status%3C400%3F(c.push(%60%24%7Be%7D%20is%20a%20redirect%20(%24%7Bt.status%7D)%60)%2Cn.style.color%3D%22orange%22)%3A(c.push(%60%24%7Be%7D%20returned%20status%20%24%7Bt.status%7D%60)%2Cn.style.color%3D%22orange%22)%2Cs%2B%2B%2Co()%7D).catch(()%3D%3E%7Br%3E0%3FsetTimeout(()%3D%3Et(e%2Cn%2Cr-1)%2C1e3)%3A(c.push(%60%24%7Be%7D%20could%20not%20be%20reached%20after%20multiple%20attempts%60)%2Cn.style.color%3D%22red%22%2Cs%2B%2B%2Co())%7D)%7Dfunction%20o()%7Bconst%20t%3Ds%2Fr.length*100%3Bi.update(t)%2Cs%3D%3D%3Dr.length%26%26setTimeout(()%3D%3E%7Bi.remove()%2Cfunction(t)%7Bconst%20o%3Ddocument.createElement(%22div%22)%3Bo.className%3D%22link-checker-overlay%22%2Co.onclick%3Dt%3D%3E%7Bt.target%3D%3D%3Do%26%26e(o)%7D%3Bconst%20n%3Ddocument.createElement(%22div%22)%3Bn.className%3D%22link-checker-modal%22%3Bconst%20r%3Ddocument.createElement(%22span%22)%3Br.className%3D%22link-checker-close%22%2Cr.innerHTML%3D%22%5Cxd7%22%2Cr.onclick%3D()%3D%3Ee(o)%3Bconst%20c%3Ddocument.createElement(%22div%22)%3Bc.className%3D%22link-checker-content%22%3Bconst%20s%3Ddocument.createElement(%22pre%22)%3Bs.textContent%3Dt%2Cc.appendChild(s)%2Cn.appendChild(r)%2Cn.appendChild(c)%2Co.appendChild(n)%2Cdocument.body.appendChild(o)%7D(c.join(%22%5Cn%22))%7D%2C100)%7Dconst%20n%3Ddocument.createElement(%22style%22)%3Bn.textContent%3D%22.link-checker-modal%20%7Bposition%3Afixed%3Btop%3A50%25%3Bleft%3A50%25%3Btransform%3Atranslate(-50%25%2C%20-50%25)%3Bbackground%3Awhite%3Bpadding%3A20px%3Bborder-radius%3A5px%3Bbox-shadow%3A0%202px%2010px%20rgba(0%2C0%2C0%2C0.1)%3Bmax-width%3A80%25%3Bmax-height%3A80vh%3Bz-index%3A10000%3B%7D.link-checker-content%20%7Bmax-height%3Acalc(80vh%20-%2040px)%3Boverflow-y%3Aauto%3B%7D.link-checker-overlay%20%7Bposition%3Afixed%3Btop%3A0%3Bleft%3A0%3Bright%3A0%3Bbottom%3A0%3Bbackground%3Argba(0%2C0%2C0%2C0.5)%3Bz-index%3A9999%3Bcursor%3Apointer%3B%7D.link-checker-close%20%7Bposition%3Aabsolute%3Btop%3A10px%3Bright%3A10px%3Bcursor%3Apointer%3Bfont-size%3A20px%3Bcolor%3A%23666%3B%7D.link-checker-close%3Ahover%20%7Bcolor%3A%23000%3B%7D.progress-container%20%7Bposition%3Afixed%3Btop%3A20px%3Bright%3A20px%3Bbackground%3Awhite%3Bpadding%3A15px%3Bborder-radius%3A5px%3Bbox-shadow%3A0%202px%2010px%20rgba(0%2C0%2C0%2C0.1)%3Bz-index%3A10000%3Bmin-width%3A200px%3B%7D.progress-bar%20%7Bwidth%3A100%25%3Bheight%3A20px%3Bbackground-color%3A%23f0f0f0%3Bborder-radius%3A10px%3Boverflow%3Ahidden%3B%7D.progress-fill%20%7Bheight%3A100%25%3Bbackground-color%3A%234CAF50%3Bwidth%3A0%25%3Btransition%3Awidth%200.3s%20ease%3B%7D.progress-text%20%7Btext-align%3Acenter%3Bmargin-top%3A5px%3Bfont-family%3AArial%2C%20sans-serif%3B%7D%22%2Cdocument.head.appendChild(n)%3Bconst%20r%3DArray.from(document.querySelectorAll(%22a%22)).filter(e%3D%3E%21e.href.startsWith(%22mailto%3A%22)%26%26%21e.href.startsWith(%22javascript%3A%22))%2Cc%3D%5B%5D%3Blet%20s%3D0%3Bif(0%3D%3D%3Dr.length)return%20void%20alert(%22No%20valid%20links%20found%20on%20this%20page.%22)%3Bconst%20i%3Dfunction()%7Bconst%20e%3Ddocument.createElement(%22div%22)%3Be.className%3D%22progress-container%22%3Bconst%20t%3Ddocument.createElement(%22div%22)%3Bt.className%3D%22progress-bar%22%3Bconst%20o%3Ddocument.createElement(%22div%22)%3Bo.className%3D%22progress-fill%22%3Bconst%20n%3Ddocument.createElement(%22div%22)%3Breturn%20n.className%3D%22progress-text%22%2Cn.textContent%3D%22Checking%20links%3A%200%25%22%2Ct.appendChild(o)%2Ce.appendChild(t)%2Ce.appendChild(n)%2Cdocument.body.appendChild(e)%2C%7Bupdate%3Ae%3D%3E%7Bo.style.width%3D%60%24%7Be%7D%25%60%2Cn.textContent%3D%60Checking%20links%3A%20%24%7BMath.round(e)%7D%25%60%7D%2Cremove%3A()%3D%3E%7Bdocument.body.removeChild(e)%7D%7D%7D()%3Br.forEach((e%2Co)%3D%3E%7Bconst%20n%3De.href%3BsetTimeout(()%3D%3Et(n%2Ce)%2C100*o)%7D)%7D()%2Cconsole.log(%22Source%3A%20https%3A%2F%2Fcodepen.io%2Fpatte%2Fpen%2FmdNvWNx%5CnBookmarklet%20name%3A%20Check%20Links%22)%3B
← Back to all bookmarklets