HTML Formatter
Auto-indent and organize HTML markup for better readability.
Minify HTML by removing extra spaces and non-essential characters.
Removes HTML comments, whitespace between tags and redundant spaces. Everything runs locally in your browser.
It does three things only: strip HTML comments, collapse whitespace between tags, and squeeze runs of spaces into one. No quote removal, no id renaming.
Because it is pure regex, indentation inside <pre>, <textarea> and <code> is collapsed too — those blocks rely on whitespace, so exclude them before minifying.
Nothing but comments is removed and inline scripts are left alone, so the output is still valid HTML.
Paste the HTML
A full document or a fragment both work.
Check sensitive blocks
Pages with pre, code or textarea should have those blocks handled separately or their layout collapses.
Watch the size change
The panel shows byte counts before and after plus the saved percentage.
Minification replaces whitespace by regex without context, so whitespace inside pre and code is collapsed to a single space as well. Handle those blocks separately.
No. This pass only touches whitespace and comments, leaving attributes exactly as written to avoid mangling values that contain spaces or special characters.
Auto-indent and organize HTML markup for better readability.
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.