Reading Minified HTML Someone Else Deployed
By toolbelt maintainers ·
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?
Does it validate HTML?
What about template languages?
Can I format a whole page I fetched with curl?
Related tools
- JSON FormatterBeautify, validate, minify, and view JSON. Format messy API responses into readable code or compress it to save bandwidth, running safely in your browser.
- JSON ValidatorValidate JSON syntax with detailed error messages. Catch trailing commas, missing brackets, and syntax errors instantly before sending payloads to your API.
- JSON MinifierCompress JSON to a single line. Remove all unnecessary whitespace and line breaks to reduce payload size for production APIs without altering the underlying data.
- JSON ViewerView JSON in an interactive, collapsible tree structure. Easily navigate massive API responses, expand specific nodes, and inspect deeply nested objects or arrays.