Home โบ Developer Tools โบ JS Minifier
โก JS Minifier
A conservative JavaScript minifier: strips comments and blank lines, shows bytes saved.
About this JS Minifier
This is a deliberately conservative JavaScript minifier. Instead of rewriting your code, it removes block comments, full-line and trailing line comments (while respecting quoted strings), blank lines and stray indentation, and keeps every statement on its own line so automatic semicolon insertion behaves exactly as before. You get a smaller file with zero surprises.
How to use it
- Paste your JavaScript into the Input box.
- Click Minify.
- Compare the byte counts shown below the output.
- Copy the result โ and always keep your original source for future edits.
Example
Two lines like // note followed by var a = 1; minify down to the single working line var a = 1; โ the comment is gone, the code is unchanged.
Frequently asked questions
Is this as small as a full minifier like Terser?
No. Production minifiers also rename variables and rewrite expressions. This tool only removes comments and whitespace, which is safer but saves less โ typically 10โ25%.
Can it break my code?
It is designed not to: it keeps line breaks and never touches the inside of quoted strings. Still, test the output, as with any build step.
Why keep each statement on its own line?
JavaScript sometimes relies on newlines to end statements. Joining everything into one line can change meaning, so this tool never does that.
More Developer Tools
Password Generator
Create strong random passwords in your browser with a live entropy strength meter.
QR Code Generator
Turn any text or link into a QR code you can save โ generated right in your browser.
Base64 Encoder & Decoder
Encode text to Base64 or decode Base64 back, with safe UTF-8 handling for any language.
JSON Formatter
Format, minify and validate JSON, with clear error positions and quick structure stats.
URL Encoder & Decoder
Encode or decode URLs and query text safely, with component or full-URL modes.
JSON to CSV Converter
Convert a JSON array of objects to CSV, or turn CSV back into clean JSON.