HTML Formatter

Input

Output

Common issues (heuristic check, not a W3C validator)

No issues found by these checks.

About the HTML Formatter

Format or minify HTML using the browser's own lenient parser, the same one that renders real pages — plus a quick heuristic scan for common issues like missing alt text or a duplicate id, clearly not a substitute for real W3C validation.

Useful for cleaning up HTML pulled from a CMS export, an email template, or a scraped page into something readable and reviewable, or for shrinking a snippet before embedding it somewhere space-constrained. The issue checker catches the handful of mistakes that are both common and cheap to detect automatically, as a quick sanity pass rather than a full accessibility audit.

How to Use the HTML Formatter

1

Paste HTML into the input panel.

2

Switch between Formatted and Minified views, and review the Common Issues panel.

3

Copy the cleaned-up result.

Frequently Asked Questions

Is my HTML sent anywhere?

No. Formatting, minifying, and the issue check all run locally using the browser's own lenient HTML parser — nothing is uploaded.

Is the "Common issues" check a real HTML validator?

No, and it doesn't claim to be — a true W3C-conformant validator needs the full HTML5 validation ruleset, which isn't something to hand-roll or fake. This is a lightweight heuristic check for a handful of common, cheaply-detectable issues: missing alt text, duplicate ids, a missing lang attribute, deprecated tags, and empty links.

Are <script>, <style>, and <pre> reformatted too?

No — their content is whitespace-significant (or, for script/style, not HTML at all), so it's preserved exactly rather than reindented, the same way a real browser treats them.

Will formatting change how the page renders?

No — reformatting only changes whitespace between tags, which browsers ignore for layout purposes (outside of whitespace-significant elements like `<pre>`, which are left untouched). The rendered output stays the same; only the source becomes easier to read.