Skip to content
toolbelt
Back to Guides

Reading Minified HTML Someone Else Deployed

By ·

Updated

The only copy of the markup you have is 200 KB on one line. Formatting is the first step to reading it.

What is this tool?

An HTML formatter indents markup so the nesting is visible. On production output, that is the difference between reading and guessing.

How it works

I run Prettier with its HTML parser, which understands void elements, raw text elements like script and style, and the places where whitespace is significant. It is not a naive newline insertion — those mangle markup.

Example

Before:
<div class="card"><h2>Title</h2><p>Body text</p><ul><li>One</li><li>Two</li></ul></div>

After:
<div class="card">
  <h2>Title</h2>
  <p>Body text</p>
  <ul>
    <li>One</li>
    <li>Two</li>
  </ul>
</div>

When to use it

Digging into a vendor site to see how they built something. Reviewing generated marketing pages before a migration. Deciphering a template someone else wrote without indentation.

Optimization Tips

Formatted HTML is for reading, not for shipping. If you paste the output back into production, you have added whitespace between inline elements — which can change how they render. Keep it as a debugging copy.

Frequently Asked Questions

Will it break inline spacing?
Not in the output you are reading. Prettier is careful about whitespace-sensitive content, but you should not paste it back into a live page regardless.
Does it validate HTML?
It parses, and reports the errors it can recover from. It is not a validator and will not catch everything a spec checker would.
What about template languages?
Jinja, Blade and ERB generally parse — they look enough like text to Prettier. Heavily custom syntax may not.
Can I format a whole page I fetched with curl?
Yes. Save the response and paste it in.

Ready to try it out?

Put this knowledge into practice with our free tool.

Go to Tool

Related tools