HTML minifier

Paste your markup and get it back without comments, indentation or whitespace between tags. Anything inside pre, textarea, script and style blocks is left alone.

  • Runs in your browser
  • Safe with pre blocks
  • Download or copy
Original0 B
Minified0 B
Saved0 B
Reduction0%
Nothing to minify yet
Good to know

What it changes and what it leaves

1

Protected blocks

Anything inside pre, textarea, script or style is set aside before minifying and put back afterwards, so whitespace-sensitive content survives.

2

Conditional comments

Comments starting with [if are kept, because removing them changes behaviour in older browsers that still read them.

3

Inline whitespace

Collapsing the space between inline elements can change how a page renders. If a layout shifts after minifying, turn off the between-tags option.

4

Attribute quotes

Quotes are only dropped from values with no spaces or special characters. That's safe, and easy to switch off if your build tool objects.