HTML Formatter and Minifier — Indent and Compact Markup
Developer Tools
About This Tool
Format HTML with spaces or tabs, or compact whitespace while preserving preformatted text and embedded scripts. Review and copy the source output.
How to Use
- Paste HTML, up to 1,000,000 UTF-16 units.
- Choose indentation and click Format or Minify.
- Review the source output and test the page in context.
- Copy the result.
Work with HTML source
Format adds indentation with two spaces, four spaces or tabs. Minify uses conservative whitespace collapsing and retains comments. Preformatted content and embedded script and style text are not minified as JavaScript or CSS. Output remains text in the editor, not a rendered live preview.
Whitespace can matter
HTML parsing is more reliable than replacing every run of spaces, but formatting can still affect whitespace-sensitive layouts or templating syntax. External CSS using white-space rules can make ordinary text spacing significant. Test the complete page and keep the original. This tool is not an HTML sanitizer or an accessibility validator.
Limits
Input is limited to 1,000,000 UTF-16 units. Size counters show UTF-8 bytes, alongside line and element counts. The parser bundle loads from the site at first use. See the shared privacy policy.
Frequently Asked Questions
Does the output execute scripts?
Does it also compress JavaScript and CSS?
Will the layout always stay identical?
Guides & Tutorials
In-depth guides for every tool. Learn how to process your data privately, for free, right in your browser.
Read more