HTML Formatter

Format or minify HTML, keeping script, style, pre and textarea exactly as written.

379 / 500,000 characters

Formatted HTML

<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <title>Pond notes</title>
  </head>
  <body>
    <h1>Pond notes</h1>
    <!-- counted at dawn, twice -->
    <p>Woke up early and saw <strong>seven</strong> ducks.<br>Counted them <em>twice</em>.</p>
    <ul>
      <li>Bread</li>
      <li>Peas</li>
    </ul>
    <pre>  keep
  this  </pre>
    <script>
  if (ducks > 6) { log("<b>not a tag</b>"); }
</script>
  </body>
</html>

379 → 450 characters

Every tag in the output is closed — optional end tags like </li> are filled in.

What is inside script, style, pre and textarea is never touched, and conditional comments survive minifying.

More in the yard