// Developer Tool

HTML BEAUTIFIER

Paste messy or minified HTML and get clean, properly indented markup back. It reindents on open tags, dedents on close, keeps void elements inline, and preserves the exact contents of <pre>, <script> and <style>. Runs entirely in your browser — nothing is ever uploaded.

◆ Beautify HTML

Everything runs locally with a hand-written tokenizer — no libraries, no network. Your input never leaves this page.

'; run(); }); document.getElementById('copy').addEventListener('click', function(){ var btn = this; if(!output.value.length){ setStatus('error', 'Nothing to copy yet — beautify some HTML first.'); return; } var done = function(){ var old = btn.textContent; btn.textContent = 'Copied ✓'; setTimeout(function(){ btn.textContent = old; }, 1400); }; if(navigator.clipboard && navigator.clipboard.writeText){ navigator.clipboard.writeText(output.value).then(done, function(){ fallbackCopy(done); }); } else { fallbackCopy(done); } }); function fallbackCopy(done){ output.removeAttribute('readonly'); output.select(); try { document.execCommand('copy'); done(); } catch(e){ setStatus('error', 'Copy failed — select the text and copy manually.'); } output.setAttribute('readonly', 'readonly'); window.getSelection().removeAllRanges(); } // Beautify on Ctrl/Cmd+Enter from the input. input.addEventListener('keydown', function(e){ if((e.ctrlKey || e.metaKey) && e.key === 'Enter'){ e.preventDefault(); run(); } }); })();