Skip to content
Input
HTML or text
Modes
2 explicit
Runtime
Browser

Minify parsed HTML without executing it

Serialize a compact parsed tree while preserving text inside pre and textarea elements.

Local processingNo sign-upNo resource loading

Minify HTML

Source stays in this tab. Parser input is capped at 500 KiB; sanitizing uses 256 KiB.

Minified HTML

Every result is inert, copyable source or data, never live DOM.

What this tool does

Explicit-mode, bounded, local parsing

Minification removes comments and collapses whitespace-only nodes to one separator after parsing. It does not minify embedded CSS or JavaScript, and parser repairs can alter malformed source.

Preformatted content stays intact

Minification removes comments and collapses whitespace-only nodes to one separator after parsing. It does not minify embedded CSS or JavaScript, and parser repairs can alter malformed source.

The parser runs locally with a 500 KiB input cap, 100,000-node and 100-level tree limits, and a 1 MiB output cap. It never fetches URLs, loads resources, uploads source, or saves a preset.

Explicit document and fragment modes

Document mode applies the HTML document parser and may supply implied html, head, or body structure. Fragment mode parses only a pasted fragment. The selected mode is part of the result and is never inferred from the text.

Primary references

Questions and answers

Related HTML tools