๐ŸคCode Minify Savings Preview

Shrink pasted code and compare real byte counts

What this tool does and does not do

OperationApplied
Strip commentsYes
Trim line edges and blank linesYes
Collapse runs of spacesYes
Drop CSS space around punctuationYes
Inside strings and regex literalsLeft untouched
Shorten variable namesNo
Rewrite syntax or drop dead codeNo
Remove JS line breaksOnly if you ask
Collapse whitespace between HTML tagsNo

This is a preview, not a complete minifier. To avoid mistaking a // inside a string or a regex literal for a comment, every literal is lifted out first and put back verbatim, which is deliberately conservative. Variable names are not shortened and syntax is not rewritten, so the savings are smaller than a dedicated tool such as terser, esbuild or cssnano would reach. The percentage is measured on the code you pasted, not estimated from an average.

You Might Also Need

Actually shrinking the code you paste

Pick a code type, paste the original, and you get the result with comments and redundant whitespace genuinely removed, alongside the before and after byte counts and the reduction. Nothing is filled in from an average saving: the figure is measured on your own code, so the per-file variation stays visible.

The point of this tool is that it deletes conservatively. Mistaking a pair of slashes inside a string or a regex literal for a comment breaks code silently, so every literal is lifted out and preserved verbatim before the surrounding whitespace is tidied. JavaScript keeps its line breaks by default, which stops code relying on automatic semicolon insertion from breaking when lines are merged. As of October 2026 removing line breaks is offered only as an opt-in.

Variable names are not shortened, syntax is not rewritten and dead code is not removed, so this is not a complete minifier and the savings run lower than a dedicated tool. Compressed transfer size and download time are out of scope.

Frequently Asked Questions

Why is the reduction smaller than a real minifier?

This tool removes only comments and whitespace; it does not shorten variable names or rewrite syntax. Dedicated tools that do go further, at the cost of output you can no longer read. Keeping it conservative here means you can see exactly what was removed.

What happens to a pair of slashes inside a string?

They are kept as they are rather than read as a comment. Strings, template literals and regex literals are lifted out before whitespace is tidied and put back character for character, so the slashes in a URL are safe too.

Why is removing line breaks not the default?

JavaScript inserts a semicolon at a line break under certain rules, so merging lines in code that omits semicolons can change how it behaves. That is why it is an opt-in choice.