Paste HTML to indent it. Line breaks go only where the browser ignores them, so the page looks the same afterwards; a built-in check renders both versions and compares the visible text. <pre>, scripts, styles and attribute values stay exactly as written.
Open a file: (or drop it on this box)
In HTML, a line break between two tags is not free: between inline elements it renders as a space. A formatter that puts every tag on its own line turns <b>€5</b>for into €5 for, and a minifier that strips all whitespace turns Contact Us</a> <a>Terms into Contact UsTerms. This tool follows the browser's whitespace rules instead:
<a>, <b>, <span>, <img>, <button>…). Existing spaces can become line breaks, which render the same.<div>, <p>, <li>, <td>, everything in <head>), where the browser drops whitespace, and after <br>.<pre>, <textarea>, <script>, <style>, inline SVG, and any element with white-space: pre in its style attribute. Attribute values, entities and quotes are never rewritten.<h1>Invoice <small>#1042</small></h1> does not become five lines.The rules above assume each tag's default display. Real sites often restyle them: a navigation <ul> with li { display: inline }, or an inline-block grid. Then a line break between two <li> tags shows up as a gap. We measured this on 29 real home pages (Wikipedia, BBC, MDN, GOV.UK, Stripe, framework sites and more), rendering each before and after in Chromium with JavaScript off and comparing the visible text: Wikipedia and BBC News changed with this tool's default mode, and just as much with js-beautify (the engine behind most online beautifiers) and Prettier (which also refused 3 of the 29 pages over syntax errors). Stripping every space next to block tags changed Wikipedia and NPR's text-only site.
So the page runs that check for you: after formatting, it renders the input and the output in two sandboxed frames (inline CSS applied, no scripts, nothing fetched) and compares the text a reader would see. If it differs, switch Whitespace to Strict: line breaks then go only where there was already whitespace, which keeps the rendering identical under any CSS (all 29 pages unchanged, formatted and minified). The minifier uses Strict by default: it keeps one space where whitespace touched a block tag, which cost 0.29% of the size on those 29 pages. Try the Inline-list example button to see both modes.
Browsers never reject HTML; they repair it silently, which is how a missing </div> ends up swallowing the footer. The formatter builds the same tree the browser does (implied </p>, </li> and </td> are fine and not reported) and lists what it had to repair, with line numbers:
</img> or </input>.id values, which break labels, anchors and getElementById.<script>, <style> or <textarea> that is never closed, so the rest of the page becomes its content.Formatting an invoice, a report or an email template? The Shotmint API renders HTML in real Chromium: POST https://shotmint.creasework.com/v1/pdf with {"html": "…"} returns a PDF, and /v1/screenshot returns a PNG (1 credit each; 25 free renders a month, then €5 for 2,000 that never expire). Scripts, AI agents and Make or Zapier can get a key with a bare POST https://shotmint.creasework.com/v1/keys/free (no body, JSON reply); the request bodies are described in openapi.json. To check a page live while you edit it, use the HTML editor.
Get 25 free renders a month API docs
Is my HTML uploaded? No. Formatting and the rendered check run in your browser. The check frames block scripts and every network request, so nothing in your HTML is fetched or executed.
Does it format the CSS and JavaScript inside the page? No. Code in <style> and <script> is kept as written, so a minified bundle stays minified and nothing in it can break.
Does the minifier remove optional tags or attribute quotes? No. It removes indentation, line breaks and comments only. Dropping quotes and optional tags saves a few more bytes but makes the markup fragile to edit, and gzip already compresses most of that away.
Related tools: HTML beautifier, HTML minifier, HTML viewer, HTML editor, HTML to Markdown, XML formatter, JSON formatter.
XML formatter · JSON formatter · Word to HTML · HTML to Markdown · HTML to Word · Markdown to HTML · Online HTML editor · HTML viewer · HTML to PDF · HTML to image · PDF to HTML · DOCX to HTML · HTML Beautifier · HTML Decode · HTML Encode · HTML Minifier · HTML to DOCX · HTML to JPG Converter · all free tools