Format and indent HTML

Indent or minify HTML in your browser without changing how the page looks. Inline text stays on one line, pre and scripts stay exact, open tags are listed.

Format HTML in three steps

  1. 1

    Paste the HTML or open a file

  2. 2

    Choose the indentation or minify

  3. 3

    Format it and copy or download the result

Readable HTML that renders the same

HTML saved from a browser, a CMS export or a build tool often arrives on one long line, or with indentation that drifted after years of edits. Formatting puts each block on its own line at its depth so the structure can be read, and minifying does the reverse.

Why some formatters change the page

Whitespace in HTML is not always cosmetic. Between two words, or a word and a link, any run of spaces and line breaks shows as one space. A formatter that puts every tag on its own line adds a space between <b>bold</b> and the comma after it, and your text gains gaps it never had. This one breaks lines only at the edges of block elements, where whitespace never shows, and keeps inline content together.

What stays exactly as written

The contents of pre, textarea, script and style are copied character for character. Every tag is copied as written, attributes, quotes and order included. HTML that omits optional end tags, such as list items without </li>, is read the way browsers read it and indented to match.

Checking the structure

After formatting, the summary lists any element left open and any end tag that closes nothing, which are the usual cause of a layout that falls apart halfway down a page. Nothing is fixed for you, because a guess about where a tag should end can be wrong.

Everything you need

Whitespace only where it is safe

Breaks go at block edges, never between a word and a link, so the page looks exactly as it did before.

Mistakes listed, not hidden

Tags left open and stray end tags are named after formatting, while the end tags HTML lets you omit are not flagged.

Minify the same way

Minify removes whitespace between blocks and keeps the single spaces that render, so text never runs together.

Nothing uploaded: open the Network panel while it runs and check.

No daily limits or watermarks: free batches take up to 20 images.

Works offline: once the page has loaded, on any current browser.

Frequently asked questions

Can formatting change how my page looks?

Not here. Lines are only broken at the edges of block elements such as a div, a paragraph or a table cell, where browsers ignore whitespace. Text and inline tags such as a link or bold word stay on one line, so no space appears or disappears between them.

What happens to pre, script and style?

They are copied exactly, character for character. Whitespace inside pre and textarea is part of what they show, and script and style are code this tool does not rewrite.

Does it fix broken HTML?

No. It never adds or removes a tag. It lists any tag left open and any end tag with nothing to close, so you can fix them yourself. End tags HTML allows you to leave out, such as li and td, are not counted as mistakes.

Is my HTML uploaded?

No. It is formatted in this browser tab. Templates and saved pages often carry tokens, emails or customer data, and none of it leaves your device.

Related guides

Work with files privately and confidentlyPractical, sourced explanations for safer file conversion, sharing, and cleanup.