Skip to content

Developer Tools

HTML Formatter

Beautify or minify HTML markup locally in the browser.

Your information is processed in your browser and is not uploaded to our servers.

HTML

Formatted output

About this tool

The formatter tokenises tags, comments and text, then reprints with two-space indentation or a compacted single block.

How to use

  1. Paste HTML.
  2. Beautify or minify.
  3. Copy the result.

Formula and methodology

Opening tags increase indent; closing tags decrease it. Void tags such as br and img do not increase depth.

Worked example

A one-line doctype document becomes a readable multi-line tree.

Frequently asked questions

Does this execute scripts?+

No. It only rewrites text.

Will it fix broken HTML?+

No. It pretty-prints what you give it.

Related tools