Beautify or minify HTML
HTML that has been minified or generated by a tool is almost unreadable — one long line with no indentation. Beautifying re-indents it so the nesting of elements is clear and you can actually edit it. Minifying does the reverse, stripping whitespace to shrink the file for faster delivery. This tool does both, so you can switch between the readable and the compact form.
How to use it
- Paste your HTML.
- Choose beautify to format it, or minify to compress it.
- Copy the result.
When to use each
- Beautify when you've inherited messy markup and need to understand or edit it.
- Minify when shipping to production, where smaller files load faster.
- Keep a readable source and minify as a build step, rather than editing minified code.
Questions people ask
Will formatting change how the page renders? No — whitespace between most elements doesn't affect the result, so the page looks the same.
Is my code uploaded? No — formatting runs entirely in your browser.