Paste your HTML, CSS, or JavaScript below and click Minify to strip whitespace, comments, and unnecessary characters. Works entirely in your browser — nothing is sent to a server.
How It Works
The tool runs entirely in your browser using pure JavaScript — your code is never uploaded anywhere.
| Language | What gets removed |
|---|---|
| HTML | Comments, redundant whitespace, optional closing tags |
| CSS | Comments, whitespace, trailing semicolons, duplicate selectors |
| JavaScript | // and /* */ comments, excess whitespace (string-safe) |
The Beautify button does the reverse: it re-indents and formats your code for readability.
Tips
- Upload a file directly using the Upload file button — the language tab switches automatically based on the file extension.
- The size reduction percentage is calculated on UTF-8 byte length, matching what browsers and servers measure.
- For JavaScript, whitespace inside string literals and template literals is preserved to avoid breaking your code.
- Run minified code through Beautify first if you need to debug it.
Related tools: SQL Formatter | JSON Formatter
