HTML Minifier

Open Source

by HTML Minifier

Provided by HTML Minifier

Not yet rated
Platform
Web
Pricing
Open Source
Account required
No
Ads
None
Last verified
10 hours ago
Developer
HTML Minifier
Official URL

Overview

This is the web page for HTML Minifier, the open-source JavaScript library created by Juriy "kangax" Zaytsev in 2010. You paste HTML, tick the options you want, and it strips out unneeded characters, with switches for collapsing whitespace, removing comments, removing optional tags and redundant attributes, shortening the doctype and more. It can also minify inline CSS with clean-css and inline JavaScript with UglifyJS.

Be aware that this page and the kangax repository are marked as deprecated. The last release from the original project was version 4.0.0 in 2019, and the repository now says the package is maintained by Jens Oliver Meiert at github.com/j9t/html-minifier, with an updated web version at htmlminifier.org. The well-known forks HTML Minifier Terser and HTML Minifier Next also descend from it.

The old page still works and runs the minifier in your browser, but for current HTML and modern JavaScript syntax it makes more sense to use the maintained version, either on htmlminifier.org or through the html-minifier npm package and command-line tool.

Features

  • Collapse whitespace, with conservative and line-break preserving modes
  • Remove comments and process conditional comments
  • Remove optional tags, empty elements and redundant or empty attributes
  • Remove attribute quotes and collapse boolean attributes
  • Minify inline CSS with clean-css and inline JavaScript with UglifyJS
  • Options to sort attributes and class names
  • Runs in the browser from a single page
  • Same engine available as an npm package with a command-line tool

Privacy

The minifier runs as JavaScript in your browser, so the HTML you paste is not sent to a server. The page is hosted on GitHub Pages.

Pros & Cons

Pros

  • Free and open source under the MIT licence
  • Very fine-grained control over what gets removed
  • Minification happens in your browser
  • No account, sign-up or ads

Cons

  • This page is deprecated and frozen at the 2019 version 4.0.0
  • No longer receives fixes for newer HTML or JavaScript features
  • Aggressive options can break pages, so output needs testing
  • The maintained successor lives at a different address

Community Reviews (0)

No written reviews yet — be the first to rate this tool.

Similar Tools