HTML Formatter
Beautify or minify HTML with Prettier. Produces clean, consistently indented markup.
About HTML Formatter
HTML Formatter runs your markup through Prettier to produce clean, consistently indented HTML, or minifies it when you want the smallest possible payload. It's the quick fix for tangled markup pasted from an email template, a CMS export, or a build artifact. It works fully in the browser, so nothing about the page you're formatting gets sent anywhere.
- Category
- dev
- Input
- Accepts: text/html or text/plain.
- Output
- Outputs: text/html.
- Cost
- Free, runs in your browser
- Memory
- low
Common uses
- Re-indent an email-template HTML blob exported from a marketing tool so you can edit it by hand
- Beautify minified production HTML you saved from View Source to understand the page structure
- Minify a small HTML snippet before embedding it as a string in your app's source
- Clean up CMS-generated markup with inconsistent indentation before pasting it into a code review
- Format a static landing page's HTML so the nested sections and divs line up readably
- Standardize indentation across a set of HTML partials so diffs only show real changes
Frequently asked questions
What formats can I paste in?
It takes HTML as text/html or plain text. Full documents and standalone fragments both work.
Does it beautify and minify?
Yes. Beautify uses Prettier to produce readable, indented markup; minify collapses whitespace for a compact output.
Is my HTML uploaded for processing?
No. Formatting happens locally in your browser, so the page content, inline data, and any embedded URLs stay on your machine.
Will it touch my inline scripts or styles?
It reformats the HTML structure and preserves the content of inline script and style blocks. For dedicated CSS or JS cleanup, format those separately.
Can it handle malformed markup?
Prettier is fairly tolerant and will reformat most real-world HTML, but badly broken structure (unclosed tags in odd places) may produce unexpected nesting. Fixing the source and re-running gives the cleanest result.
Keywords
- html
- format
- beautify
- minify
- pretty
- indent
- markup