HTML Formatter
An HTML Formatter re-indents minified or messy HTML into readable markup using Prettier's own engine in your browser, formatting embedded <style> and <script> blocks at the same time.
(formatted output appears here)About HTML Formatter
Paste minified or hand-mangled HTML and get it back properly indented, with attributes wrapped sensibly and inline CSS and JavaScript formatted too — most online beautifiers leave embedded blocks as one long line. This runs the real Prettier engine, self-hosted and bundled with the page rather than loaded from a CDN, so the output matches what your editor would produce and your markup never leaves the tab. If the document won't parse you get the exact line and column instead of silently mangled output.
What HTML Formatter does
- Runs the real Prettier engine, self-hosted — no CDN
- Formats embedded <style> and <script> blocks too
- Whitespace sensitivity modes: CSS-aware, strict, ignore
- Optional one-attribute-per-line for long tags
- Exact line and column on a parse error
- Indent width or tabs, plus configurable wrap column
When to reach for HTML Formatter
- Reading a minified page you saved or inspected
- Cleaning up exported or generated markup
- Making an email or CMS template reviewable in a diff
- Normalising indentation before committing a template
How to use HTML Formatter
- 01
Paste your HTML
Paste minified or messy markup into the input pane.
- 02
Adjust options
Set indentation, wrap column, and whitespace sensitivity.
- 03
Copy or download
Copy the formatted markup or download it as a file.
When to use HTML Formatter vs alternatives
| Alternative | Use HTML Formatter when… | Use the alternative when… |
|---|---|---|
| Your editor's format-on-save | you're on a borrowed or locked-down machine, or the snippet isn't in a project yet. | the file already lives in a repo you have open. |
| A generic online beautifier | you want Prettier's canonical output, embedded CSS/JS formatted, and no upload. | you need a legacy indentation style Prettier doesn't offer. |