Skip to content
Tooletto

HTML Beautifier

A preset of HTML Formatter

Turn minified or badly-indented HTML back into something readable. Paste a single compressed line and get properly nested markup with consistent indentation — including any CSS and JavaScript embedded in the page.

  • Files never leave your device
  • Free, no signup
  • No watermarks
  • Works offline once loaded
Loading tool…

How to html formatter

  1. 1

    Paste your HTML

    Minified, badly indented or hand-written — it all works.

  2. 2

    Choose indentation

    2 spaces, 4 spaces or tabs.

  3. 3

    Copy the result

    Or download it as an .html file.

Reading minified markup someone else shipped

Minified HTML — collapsed onto one or a handful of long lines by a build tool — is optimised entirely for transfer size, not for a person to read, which becomes a real obstacle the moment you need to inspect a competitor's page structure, debug a production issue by viewing source, or understand how a third-party embed is actually built. Beautifying it restores the nesting a human reader needs to follow: each element on its own line, indented to reflect how deeply it sits inside its parents, which is the representation a person actually reasons about rather than the single dense line a build tool optimised for machines to transfer.

Recovering structure from a page you did not write

Inspecting a page built by someone else — a competitor's landing page, an embed widget's markup, an old project with no accessible source — is one of the most common reasons to reach for a beautifier specifically: browser developer tools show the live rendered DOM, which is useful for one purpose, while beautifying the raw HTML source shows the actual document structure the server sent, indentation restored, which is a different and often more useful view when trying to understand how a page was actually built rather than how it ended up rendering.

Frequently asked questions

Does it format CSS and JavaScript inside the page?

Yes. Content inside `<style>` and `<script>` is handed to the CSS and JavaScript parsers, so an entire single-file page formats correctly rather than leaving those blocks untouched.

Will formatting change how my page renders?

Almost never, but not quite never: HTML treats whitespace as significant inside `<pre>`, `<textarea>` and elements with `white-space: pre`. Those are left exactly as they are. Inline elements can shift by one space in edge cases, which is why the formatter is conservative around them.

Why does it reject my HTML?

Usually genuinely unbalanced tags, or template syntax such as Handlebars, Jinja or Blade that is not valid HTML. Browsers silently repair broken markup; a formatter has to understand the structure, so it cannot.

Is my markup uploaded anywhere?

No. The parser runs in your browser, so unreleased pages and client work stay on your machine.