Skip to content
Allin

HTML Compressor

Minify HTML by removing comments and collapsing whitespace to reduce page weight.

Open HTML Compressor and you get an answer straight away, with no account to create. It sits under Data & computing in our catalogue, alongside CSS Compressor and HTML Beautifier.

How to use it

  1. Open the tool — no signup or install needed.
  2. Enter your input or adjust the available options.
  3. Get your result instantly, then copy or download it.

Frequently asked questions

What does HTML Compressor do?

Minify HTML by removing comments and collapsing whitespace to reduce page weight.

When would I actually use this?

Finding out how big a thing will be before you make it: how many gigabytes an hour of footage takes, how long a file needs on the connection you have, how large a photo prints before it goes soft, what bitrate fits the budget you were given.

What is the most common mistake?

Taking the advertised connection speed as the transfer speed. A 100 Mb/s line is megabits, the file is in megabytes, and the eight-fold difference between them is where most download estimates go wrong — before overhead and contention take their own share.

How is HTML Compressor different from CSS Compressor?

They sit next to each other but answer different questions: CSS Compressor is the one to open when you need it to minify CSS by stripping comments and whitespace to shrink your stylesheet's size. Pick whichever matches what you're starting from — both are free.

Is there a tool for the next step?

HTML Beautifier is the closest one after this: Turn minified or tangled HTML into cleanly indented, readable markup — or minify it.

What else is worth having open alongside it?

HTML Entity Encoder / Decoder and ASCII Table Reference — they come up in the same task often enough to be worth a second tab.

Where do the figures come from?

Byte prefixes follow the IEC convention where a kibibyte is 1 024 bytes and a kilobyte is 1 000 — drive makers use the second, operating systems often report the first, and a disk that shrinks on arrival is that gap and nothing else. Print sizing assumes 300 dpi unless you change it.

Further reading

All guides
GuideWhat a Minifier Can Remove, and What It Must NotMinification has to preserve meaning, and the interesting part is the whitespace that carries meaning: the descendant combinator, the spaces inside calc(), the gap between two inline elements. Measured here on real files, including how much brotli was going to save you anyway.ExplainerThe Golden Hour and the Blue Hour Are Angles, Not HoursGolden hour runs from +6° to −4° of solar elevation and blue hour from −4° to −6°, which is why it lasts forty minutes at the equator, over an hour at mid-latitudes, and above 72.6° in June does not happen at all. The thresholds this calculator uses, checked against its own output.ExplainerDepth of Field: What Actually Controls ItFour variables set depth of field, and subject distance dominates the other three. The exact formulas, a computed table, why the circle of confusion is a decision rather than a measurement, and what "full frame has less depth of field" really means.ExplainerThe Exposure Triangle Is Three Routes to the Same StopA stop is a factor of two in light. The f-number scale is powers of √2 for a reason you can derive in one line, EV = log2(N²/t) puts a number on it, and the three controls are equivalent in brightness only — never in the picture.GuideBeautify or Minify: What Each Is For, and What It Does to the WeightFour real stylesheets run through the minifier, measured raw and after gzip. Stripping every space saved 48, 103, 104 and 147 compressed bytes; stripping comments saved 57, 1 358, 2 420 and 1 042. Plus the five inputs this minifier breaks.GuideBuilding a URL With Parameters That Survives a Copy-PasteThree encodings, one visible difference: %20 or +. The builder's form mode matches URLSearchParams byte for byte on seventeen values — but give it a base URL with a fragment and every parameter lands inside the hash, where no server sees it.