HTML formatter
Beautify HTML with consistent indentation, or minify it by removing comments and spare whitespace.
Missing a feature or found a bug in HTML formatter? Tell me on X (@_andrewtran) or by email.
How to use HTML formatter
- Paste your HTML in the input pane.
- Choose 2 spaces, 4 spaces or Minify.
- Copy the result or download it as a file.
Questions and answers
Is my data sent anywhere?
No. Everything runs in your browser on this device. Nothing you paste is uploaded or stored.
Does minifying change how the page looks?
It should not. A space between inline elements is kept, because it shows on the page. The contents of pre, textarea, script and style are left as written.
Are scripts and styles minified too?
No. Only the HTML around them is. Use the CSS formatter for style sheets.
Related tools
CSS formatter
Beautify CSS rules and media queries, or minify CSS with strings and comments handled safely.JSON viewer
Explore JSON as a collapsible tree, with counts for every object and list.Mock data generator
Generate made-up users, orders and products as JSON, CSV or SQL, from a schema you can edit.Gitignore generator
Build a .gitignore by combining templates for your languages, frameworks, editors and system.