About HTML Formatter / Minifier
Use Prettier for consistent formatting or remove comments and collapse safe whitespace without executing the input.
HTML Formatter / Minifier uses Prettier for consistent readable output and a conservative HTML minifier for smaller delivery markup. Embedded JavaScript and CSS are not minified automatically.
How to use it
- Paste HTML and select indentation and line width.
- Choose readable formatting or conservative minification.
- Review and download the processed HTML.
Common use cases
- Reformat copied templates before reviewing them.
- Reduce comments and unnecessary whitespace in a static HTML fragment.
- Compare readable development markup with a compact delivery version.
Worked example
Format a compressed landing-page template for review, then create a minified delivery copy.
Limitations and responsible use
- Formatting is opinionated and may rewrite whitespace around inline elements.
- Minification can affect whitespace-sensitive templates, preformatted content, or framework syntax.
- The tool does not execute, sanitize, or prove the security of the HTML.
Frequently asked questions
Will the preview execute my HTML?
No. Input is processed as text and returned in the output editor.
Are script and style contents minified?
No. They are deliberately left alone to avoid applying language transforms the user did not request.