HTML minifier & beautifier

Paste HTML and either minify it — stripping comments and collapsing the whitespace between tags — or beautify it with clean indentation. A real tokenizer keeps the content of pre, textarea, script and style exactly as it was. Nothing is uploaded.

Your HTML
Mode
Options

Everything runs in your browser. No upload, no sign-up.

How it works

STEP 1

Paste your HTML

Drop in a page or a fragment of any size. Tags, comments, the doctype and raw blocks like script and style are all handled.

STEP 2

Minify or beautify

Minify to strip comments and collapse whitespace for the smallest output, or beautify to re-indent every tag cleanly. Pick your indent and options.

STEP 3

Copy or download

See the byte size saved, then copy the result with one click or download it as an .html file. Nothing leaves your device.