</> 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
- Paste into Input HTML. Pasting runs Beautify automatically.
- Set Indent to 2 or 4 spaces. Tick or untick Preserve inline elements and Remove comments.
- Press Beautify or Minify. Sizes and the percentage change appear under the boxes.
- 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.
- Spaces next to tags are removed, including meaningful ones.
<p>This is a <strong>sample</strong> page.</p>renders as "This is asamplepage." - Closing tags for
p,li,td,trand similar are always removed. Where text follows, the meaning changes:<div><p>a</p>text</div>puts "text" inside the paragraph. - Quote removal also applies to ordinary text, so the sentence
Set x="abc" hereloses its quotes. - Inside preserved blocks, dollar sequences can be altered when the block is put back.
var a='$'; var b='$$';came out asvar a='; var b='$';, which breaks the script.
Beautify is about layout, and it can alter some content
- Text and inline elements go onto separate lines, which adds whitespace.
one<b>two</b>threegets spaces between the words when rendered. - Preserve inline elements only keeps a short inline tag on one line with its own text. Untick it and even
<a>Home</a>takes three lines. - Content in
pre,scriptandstyleis kept, but it is moved to a new indented line, so the first line of apregains leading spaces. - Unclosed tags are not understood.
<li>without its closing tag keeps pushing the indentation deeper. This includes Minify's own output, so re-beautifying a minified file drifts to the right. - Mismatched tags are not reported. The status message says the HTML was beautified successfully regardless.
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.