Developer tools

HTML beautifier and minifier

Format or compact HTML source locally, with copy and file download.

HTML beautifier and minifier
Esc to restore

Your inputs

Up to 200,000 characters. Source is processed locally and never executed.

Results update as you type. Larger files run when you press Update result.

Your result

Your result will appear here.

More actions

Your inputs stay in this browser. Nothing is uploaded or saved.

A clear answer. Here’s how.

Formats HTML with Prettier using strict whitespace sensitivity. Conservative minification compacts whitespace inside tags and removes ordinary comments, preserving conditional and directive comments, every text node, quoted attribute value, ERB block and raw script, style, pre and textarea content. It does not minify embedded languages, validate a page or guarantee that beautifying whitespace-sensitive markup is visually identical. Up to 200,000 characters.

How this is checked

2 reference checks passed These 2 cases were run when this page was built, on 3 December 2026, and all reproduce within the stated tolerance. The same cases are part of the automated tests that run on every change to Toolmoz. Engine version 1.

See the checks and where each expected answer comes from
  1. Case 1

    Inputs
    Source <p class="x" >a b</p>Output minify
    Expected, and what Toolmoz gave
    text expected <p class="x">a b</p>, Toolmoz <p class="x">a b</p>
    Where the expected answer comes from
    HTML whitespace separates attributes; one separator is sufficient and text a b stays unchanged.
    Allowed difference
    exact
  2. Case 2

    Inputs
    Source <b>a</b> <i>b</i>Output minify
    Expected, and what Toolmoz gave
    text expected <b>a</b> <i>b</i>, Toolmoz <b>a</b> <i>b</i>
    Where the expected answer comes from
    The space between inline elements is rendered text and must be retained.
    Allowed difference
    exact

What this shows: the engine reproduces independently worked values for these cases. It does not prove every possible input is right. To test an answer you were given, see how to check a number; to see what is and is not checked across Toolmoz, see the accuracy ledger.

See a worked example

Worked example

A fixed demonstration, separate from the values you enter above.

Source
<main><h1>Hello</h1><p>Welcome to Toolmoz.</p></main>
Output
Beautify
Indent
2 spaces

Example result

<main><h1>Hello</h1><p>Welcome to Toolmoz.</p></main>

Source is parsed locally and never executed. Review formatting before using the result.