Top 20 Useful Bookmarklets for Developers
Essential bookmarklets every developer should have in their toolkit for debugging, testing, and productivity.
Why Developers Love Bookmarklets
Bookmarklets are powerful micro-tools that can instantly transform any webpage. For developers, they're invaluable for debugging, testing, and analyzing websites without opening DevTools or installing extensions.
💡 Pro Tip
Create a "Dev Tools" folder in your bookmarks bar and organize these bookmarklets by category for quick access.
Essential Developer Bookmarklets
🐛 Debugging Tools
1. View All JavaScript Errors
Shows all JavaScript errors on the page in a popup
javascript:(function(){var errors=[];window.onerror=function(msg,url,line){errors.push(msg+' at '+url+':'+line);return true};alert(errors.length?errors.join('\n'):'No errors detected')})();
2. Show All Event Listeners
Highlights elements with event listeners attached
javascript:(function(){document.querySelectorAll('*').forEach(el=>{if(el._listeners||el.onclick||el.onmouseover){el.style.border='2px solid red';el.title='Has event listeners'}})})();
3. Console Log Viewer
Creates an on-page console for mobile debugging
javascript:(function(){var d=document.createElement('div');d.style='position:fixed;bottom:0;right:0;background:#000;color:#0f0;padding:10px;max-height:200px;overflow:auto;z-index:9999';d.id='mini-console';document.body.appendChild(d);var log=console.log;console.log=function(){var msg=Array.from(arguments).join(' ');d.innerHTML+='<div>'+msg+'</div>';log.apply(console,arguments)}})();
🎨 CSS & Styling Tools
4. Show All CSS Classes
Lists all unique CSS classes used on the page
javascript:(function(){var classes=new Set();document.querySelectorAll('[class]').forEach(el=>el.classList.forEach(c=>classes.add(c)));alert('Classes ('+classes.size+'):\n'+Array.from(classes).sort().join('\n'))})();
5. Grid Overlay
Adds a responsive grid overlay for alignment checking
javascript:(function(){var d=document.createElement('div');d.style='position:fixed;top:0;left:0;right:0;bottom:0;background:repeating-linear-gradient(90deg,rgba(255,0,0,.1)0,rgba(255,0,0,.1)1px,transparent 1px,transparent 100px),repeating-linear-gradient(0deg,rgba(255,0,0,.1)0,rgba(255,0,0,.1)1px,transparent 1px,transparent 100px);pointer-events:none;z-index:9999';d.onclick=function(){this.remove()};document.body.appendChild(d)})();
6. Remove All Styles
Strips all CSS from the page to see raw HTML structure
javascript:(function(){document.querySelectorAll('style,link[rel="stylesheet"]').forEach(el=>el.remove());document.querySelectorAll('*').forEach(el=>el.removeAttribute('style'))})();
⚡ Performance Analysis
7. Image Size Analyzer
Shows dimensions and file sizes of all images
javascript:(function(){document.querySelectorAll('img').forEach(img=>{var info=document.createElement('div');info.style='position:absolute;background:red;color:white;padding:2px;font-size:10px;z-index:9999';info.textContent=img.naturalWidth+'x'+img.naturalHeight;img.parentElement.style.position='relative';img.parentElement.appendChild(info)})})();
8. Resource Counter
Counts all external resources loaded by the page
javascript:(function(){var r={img:document.images.length,script:document.scripts.length,style:document.styleSheets.length,iframe:document.querySelectorAll('iframe').length};alert('Resources:\n'+Object.entries(r).map(([k,v])=>k+': '+v).join('\n'))})();
9. Lazy Load Detector
Highlights images using lazy loading
javascript:(function(){document.querySelectorAll('img[loading="lazy"],img[data-src]').forEach(img=>{img.style.border='3px solid orange';img.title='Lazy loaded'})})();
🔍 SEO & Accessibility
10. Heading Structure
Shows the page's heading hierarchy
javascript:(function(){var h=[];document.querySelectorAll('h1,h2,h3,h4,h5,h6').forEach(el=>{h.push(el.tagName+': '+el.textContent.trim())});alert(h.join('\n'))})();
11. Alt Text Checker
Highlights images missing alt text
javascript:(function(){document.querySelectorAll('img').forEach(img=>{if(!img.alt){img.style.border='5px solid red';img.title='Missing alt text'}else{img.style.border='5px solid green';img.title='Alt: '+img.alt}})})();
12. Meta Tags Viewer
Displays all meta tags in the page head
javascript:(function(){var meta=[];document.querySelectorAll('meta').forEach(m=>{meta.push((m.name||m.property||'charset')+': '+(m.content||m.charset))});alert('Meta Tags:\n'+meta.join('\n'))})();
📝 Form & Input Tools
13. Show Hidden Fields
Makes all hidden form fields visible
javascript:(function(){document.querySelectorAll('input[type="hidden"]').forEach(el=>{el.type='text';el.style.background='yellow';el.style.border='2px solid red'})})();
14. Form Auto-Filler
Fills forms with test data
javascript:(function(){document.querySelectorAll('input[type="text"]').forEach(i=>i.value='Test');document.querySelectorAll('input[type="email"]').forEach(i=>i.value='test@example.com');document.querySelectorAll('textarea').forEach(t=>t.value='Test content')})();
15. Password Revealer
Shows passwords in plain text
javascript:(function(){document.querySelectorAll('input[type="password"]').forEach(el=>el.type='text')})();
🛠️ Utility Tools
16. Design Mode Toggle
Makes the entire page editable
javascript:(function(){document.designMode=document.designMode=='on'?'off':'on';alert('Design mode: '+document.designMode)})();
17. Cookie Inspector
Shows all cookies for the current domain
javascript:(function(){alert('Cookies:\n'+document.cookie.split(';').join('\n'))})();
18. Local Storage Viewer
Displays all local storage data
javascript:(function(){var ls=[];for(var i in localStorage){ls.push(i+': '+localStorage[i].substring(0,50)+'...')};alert('LocalStorage:\n'+ls.join('\n'))})();
19. Page Timer
Shows how long the page has been open
javascript:(function(){var start=Date.now();setInterval(function(){document.title=Math.floor((Date.now()-start)/1000)+'s'},1000)})();
20. QR Code Generator
Creates a QR code for the current URL
javascript:(function(){window.open('https://api.qrserver.com/v1/create-qr-code/?size=200x200&data='+encodeURIComponent(location.href))})();
Installation Tips
⚡ Quick Installation
- Copy the bookmarklet code
- Right-click your bookmarks bar
- Select "Add bookmark" or "Add page"
- Give it a descriptive name
- Paste the code as the URL
- Save and you're ready to go!
Creating Your Own Developer Bookmarklets
These examples are just the beginning. You can create custom bookmarklets for your specific development workflow:
- API endpoint testers
- Environment switchers
- Feature flag toggles
- Debug mode activators
- Performance profilers
- A/B test switchers
Ready to Build More?
Use our bookmarklet generator to create custom tools for your development workflow, or explore more advanced techniques.