DevTools
Language

HTML Formatter

DevTools HTML Formatter beautifies HTML markup locally in your browser with indentation and line breaks—accepts full documents or fragments, free with no sign-up.

HTML Formatter

Beautify HTML markup with indentation and line breaks; accepts full documents or fragments.

About this tool

Tidy HTML copied from DevTools, email templates, or static snippets. Output keeps tag hierarchy for easier reading and diffing.

How to use

  1. Paste HTML (full document or fragment).
  2. Choose 2- or 4-space indent.
  3. Click Format and copy the result.

FAQ

How do I format HTML online?

On the DevTools HTML Formatter page, paste code and click Format for readable indented HTML.

Are HTML fragments supported?

Yes. You do not need a full <!DOCTYPE> document—paste div, ul, or other fragments directly.

Does formatting change page semantics?

No. Only whitespace and indentation change—tag structure and attribute values stay the same.

Is my HTML uploaded?

No. Formatting runs locally in your browser.

Related tools