HTML / CSS / JS Minifier
Remove comments and whitespace to reduce code file size
How the Minifier Works
Paste your code and select the type (HTML, CSS, or JS). The minifier runs in your browser — no code is uploaded anywhere.
HTML Minification
- Removes HTML comments (
<!-- ... -->). - Collapses sequences of whitespace between tags into a single space.
- Trims leading/trailing whitespace from each line.
CSS Minification
- Removes
/* ... */comments. - Collapses whitespace around
{ } : ; , >selectors. - Removes trailing semicolons before closing braces.
JS Minification (basic)
- Removes single-line (
// ...) and multi-line (/* ... */) comments. - Collapses sequences of whitespace to a single space.
- Trims whitespace around common operators and punctuation.
Note: This is a basic minifier — it does not perform AST-based transformations like variable renaming or dead-code elimination. For production use, consider tools like Terser or cssnano.