JS/CSS Minifier | How to use and interpret results
Reduce comments and selected whitespace with text rules for a JavaScript or CSS draft. This differs from an AST-based production minifier and is best limited to inspected examples.
- Runs in your browser
- Nothing is uploaded
- No signup; device limits apply
Loading the tool. If it does not appear, reload this page.
How to use this tool
Choose JS or CSS and keep an original copy before pasting. Comment-like text inside strings, regex literals or templates can be changed by the simple rules.
Results and examples
A small CSS rule such as a { color: red; } is shown with less whitespace. Before/after counts measure string length, not gzip-compressed transfer bytes.
Worked example
A small CSS rule such as a { color: red; } is shown with less whitespace. Before/after counts measure string length, not gzip-compressed transfer bytes.
Limitations
- The implementation is not a parser that safely preserves all strings and regex literals.
- JavaScript automatic-semicolon-insertion meaning can change, requiring real tests before deployment.
Fields
| Field | Guidance and constraints |
|---|---|
| JavaScript | Check the unit and format displayed beside this field. |
| CSS | Check the unit and format displayed beside this field. |
| Source | Check the unit and format displayed beside this field. |
| Result | Check the unit and format displayed beside this field. |
Data handling
Processing stays in the current browser tab; the site does not upload tool input for the calculation itself.
Sources
Frequently asked questions
Does the displayed reduction measure transfer savings?
A small CSS rule such as a { color: red; } is shown with less whitespace. Before/after counts measure string length, not gzip-compressed transfer bytes.
Can I deploy minified production code immediately?
The implementation is not a parser that safely preserves all strings and regex literals. JavaScript automatic-semicolon-insertion meaning can change, requiring real tests before deployment.