HTML Minifier
Minify HTML by removing extra spaces and non-essential characters.
Auto-indent and organize HTML markup for better readability.
Formats HTML with the js-beautify library and configurable indentation. Everything runs locally in your browser.
One page, two modes: formatting re-indents by HTML nesting, while minify mode removes HTML comments, collapses whitespace between tags and squeezes runs of spaces.
Indentation can be 2 spaces, 4 spaces or tabs, with tab mode treated as one indent width — pick your team convention instead of normalising later.
The engine is js-beautify rather than a pile of regexes: nesting, inline elements and comments are handled structurally, so a string inside an attribute is never mistaken for a tag.
The engine starts downloading when the page opens (around 100KB), then formatting is a synchronous local computation with no further requests in the same session.
Whitespace inside <pre> and <textarea> is preserved by js-beautify, but minify mode is a pure regex pass that also collapses runs of spaces inside <script>, so check pages with inline code before trusting the output.
Paste the HTML
A full document or a fragment both work; leading and trailing whitespace is ignored.
Pick an indent
2 spaces, 4 spaces or tabs; the markup is immediately re-laid-out so the nesting is visible.
Switch to minify when size matters
Minify strips comments and collapses whitespace, which suits email templates and inline snippets.
Copy the current mode
Changing modes regenerates the output, so confirm which mode you are copying from.
The engine downloads when the page opens, so the first use may briefly show a loading state. Once loaded it is reused for the session. If it never finishes, the engine failed to load.
No. Tags and attributes are untouched; only indentation and line breaks between tags change. Text inside <pre> and <textarea> is left alone and tag order is preserved.
No. It only formats: unclosed tags and bad attributes produce no error and are not repaired. Validate with the W3C validator or browser dev tools.
It can. Minify removes comments and collapses runs of whitespace with regexes, and the pass covers <pre> and <script> too, so multi-space strings in scripts may change. Back up such pages and test them in a browser.
Minify HTML by removing extra spaces and non-essential characters.
Minify or prettify CSS code for production and maintenance workflows.
Beautify JavaScript code with consistent indentation and spacing.
Minify JavaScript to reduce file size for faster page delivery.
Format, validate, and beautify JSON for easier reading and debugging.
Compress JSON by removing unnecessary whitespace and line breaks.