</> HTML Beautifier & Minifier

Format, indent, and compress HTML. Runs entirely in your browser.

Last updated: November 8, 2026 · By the BoltQuickTools team

Indent minified HTML so you can read its structure

Markup copied from a page source, a CMS or a build output often arrives as one long line, which makes nesting hard to follow. This page re-indents it, and can also compact it. Both operations are plain text processing in the page.

Beautify and Minify

  1. Paste into Input HTML. Pasting runs Beautify automatically.
  2. Set Indent to 2 or 4 spaces. Tick or untick Preserve inline elements and Remove comments.
  3. Press Beautify or Minify. Sizes and the percentage change appear under the boxes.
  4. Copy Output copies the result. Sample HTML loads an example and Clear empties both boxes.

The same snippet through each button

<ul class="nav"><li><a href="/">Home</a></li><li>About <b>us</b></li></ul><!-- menu -->

Beautify with the default options:

<ul class="nav">
  <li>
    <a href="/">Home</a>
  </li>
  <li>
    About
    <b>us</b>
  </li>
</ul>
<!-- menu -->

Minify, 87 characters in and 74 out:

<ul class=nav><li><a href="/">Home</a><li>About<b>us</b></ul><!-- menu -->

Look closely at the minified text: About us has become About joined to us, and the closing li tags are gone. Comments stay unless Remove comments is ticked.

Minify changes more than whitespace

Treat Minify as a quick size estimate and check its output before using it. A build tool built for the job is the better choice for production pages.

Beautify is about layout, and it can alter some content

Questions worth asking

Does the Indent setting affect Minify?

No. Only Beautify uses it. Remove comments applies to both.

Why are my attributes still on one long line?

Each tag is kept whole on a single line. Attributes are never split or reordered.

What about CSS and JavaScript in the page?

Those blocks are left as they are. Use the CSS minifier or the JS minifier for them. For strict XML rather than HTML, the XML formatter is a better fit.