About HTML Formatter
HTML that is written by hand, copied from a template engine or generated by a build step often ends up with inconsistent indentation and long lines. This formatter runs the document through the Prettier HTML parser, which understands nesting, void elements, inline content and raw-text elements, then prints it with the indentation you choose so the structure is easy to review.
Minify takes the opposite direction: it parses the document, removes comments and collapses whitespace between tags while keeping the content of pre, textarea, script and style blocks untouched. Both modes run in the browser and both refuse documents over 10 MB. When the HTML does not parse, the parser error is shown with its line and column instead of a generic failure.
What this tool does
Real HTML parser
Formatting uses the Prettier HTML parser, so nesting, void elements and inline whitespace are handled by an established parser rather than a regex.
Two- or four-space indent
Pick the indentation the project already uses; the setting applies to the formatted output and is remembered while you edit.
Minify without breaking content
Minify removes comments and whitespace between tags, while the contents of pre, textarea, script and style are copied exactly.
Parser errors with position
Invalid markup reports the parser message plus the line and column where parsing stopped, so the broken tag is easy to find.
Copy and download
Copy the result or download it as an .html file, ready to paste back into a template or commit to the project.
Local and private
Parsing, formatting and minification run in the browser tab; the document never leaves the device and no request is made.
How to use HTML Formatter
- 01
Paste or load HTML
Paste the markup into the input pane or load a .html or .htm file from your device; files up to 10 MB are accepted.
- 02
Choose the indentation
Select two spaces or four spaces. The choice affects the formatted output only, never the text inside pre or script.
- 03
Format or minify
Press Format for readable nesting or Minify for a compact document. Both modes parse the HTML first and report errors before producing output.
- 04
Check the result
Read the output pane and the reported line count, and fix any parser error shown with its line and column.
- 05
Copy or download
Copy the HTML to the clipboard or download it as an .html file named after the uploaded document.
Supported formats and limits
- Input
- HTML
- Output
- HTML
- Processing
- Client-side, in your browser. Nothing is uploaded.
- Maximum size
- Bound by the memory available to your browser tab.
- Requirements
- Chrome, Edge, Firefox or Safari · JavaScript enabled
Limitations worth knowing
- Minify collapses whitespace between tags, so markup that depends on whitespace between inline elements can render differently.
- Comments are removed by Minify, including conditional comments; the original file is the place to keep them.
- Embedded script and style contents are not minified, only the surrounding markup.
- Input is capped at 10 MB and formatting runs on the main thread after a short yield.
Privacy and file handling
Your HTML is read, parsed and printed entirely inside this browser tab with Prettier loaded as a page script. The document is never uploaded to FormatFlow or anyone else, no copy is stored and nothing leaves your device; closing the page clears the input and the result.
Read the full privacy policy
