HTML Formatter & Minifier

Format HTML with proper indentation, or minify it for production.

Processed on your device. Files are not uploaded

How to format HTML

  1. Paste your HTML

    Paste or type your HTML into the box.

  2. Choose

    Format for readable indentation, or Minify for a compact version.

  3. Copy the result

    Copy the result, or use it straight away.

Worked example

This is what HTML Formatter & Minifier gives for its own sample values. Open the tool above and change anything to try your own.

HTML

<div class="box"><h1>Title</h1><p>Some <b>bold</b> text.</p><ul><li>One</li><li>Two</li></ul></div>

Formatted

<div class="box">
  <h1>
    Title
  </h1>
  <p>
    Some
    <b>
      bold
    </b>
    text.
  </p>
  <ul>
    <li>
      One
    </li>
    <li>
      Two
    </li>
  </ul>
</div>

About HTML Formatter & Minifier

Tidy HTML with proper indentation so it is easy to read, or minify it to cut its size for production.

FAQs

What does minify do?

It removes spaces and line breaks that are not needed, making the file smaller.

Can I format CSS too?

Use CSS Formatter & Minifier.

Related tools