Bytelify

HTML Prettifier

Format and indent messy HTML into clean, readable markup, live as you type.

Runs in your browser, nothing sent
html-prettify
Formatted

Formatted with Prettier, live as you type, entirely in your browser. Nothing you type is sent anywhere.

Need the opposite? HTML Minify

What is HTML Prettifier?

Paste minified or messily-indented HTML and get it reformatted into clean, consistently indented markup, powered by Prettier, the same formatter many code editors use. Great for making sense of a minified page's source or cleaning up hand-written HTML before committing it.

How to Use HTML Prettify

  1. 1

    Paste the Minified or Messy HTML: Enter compact or unevenly indented HTML.

  2. 2

    Read the Formatted Result Instantly: The cleanly indented markup appears automatically as you type.

  3. 3

    Copy the Result: Use the copy button to copy the readable HTML.

How It Works

Prettier's HTML parser reads the markup into an AST of nested elements, then re-prints it with each block-level element on its own line, indented one level deeper than its parent, regardless of whether the original was a single unbroken line or unevenly spaced. Attributes and text content aren't altered, only how the tags are laid out.

Example

Before
<div><h1>Welcome</h1><p>Hello world</p></div>
After
<div>
  <h1>Welcome</h1>
  <p>Hello world</p>
</div>

Each block-level element moves to its own line, indented one level deeper than its parent.

Common Use Cases

  • Reading a minified page's markup pulled from "View Source" or devtools, where the original formatted source isn't available.

  • Cleaning up HTML generated by a template engine or scaffolding tool before hand-editing it.

FAQs

Frequently Asked Questions

Common questions about HTML Prettifier.

Prettier's HTML parser, running entirely in your browser via its standalone build. It's the same tool many teams use to auto-format code in their editor or CI pipeline.

No, it formats syntax it can parse but doesn't check for HTML5 spec compliance. If it can't parse the input at all, it will say so.

Yes, Bytelify's HTML Prettifier is free with no account or sign-up required.

No. Formatting runs entirely client-side via Prettier's standalone browser build, so nothing you paste is sent anywhere.