HTML Formatter
Format and beautify HTML markup with proper indentation.
Frequently Asked Questions
Does the formatter re-indent inline elements like <a>, <span>, and <strong> differently?
Yes. Inline tags (a, abbr, b, code, em, i, label, small, span, strong, sub, sup) are kept on the same line as surrounding text instead of being pushed to their own line, so formatting a paragraph with a link inside it doesn't break the sentence flow the way a naive line-per-tag formatter would.
What does the Minify button actually strip out?
Minify removes HTML comments, collapses whitespace between tags down to nothing, reduces runs of spaces inside text to a single space, tidies quote spacing around attributes, and drops optional closing tags on </li>, </td>, </th>, </tr>, and </option> where the HTML spec allows it.
Will formatting change my actual markup or just the whitespace?
Only whitespace and indentation change. The formatter tokenizes your input into tags and text, re-indents based on nesting depth (2 spaces per level), and never rewrites attribute values, tag names, or element order.
Can I download the result instead of copying it?
Yes. Click Download after formatting or minifying to save the output as a .html file directly from the browser — no server round-trip.
Is there a line/character count so I can see how much I saved by minifying?
Yes. The tool shows live Lines and Characters badges below the editors, so you can compare the size of your input against the minified output at a glance.