Developer · Both directions

Code Minifier & Beautifier

Squeeze it down, or open it back up

Minify or beautify HTML, CSS and JavaScript, with a size report and safe handling of strings, comments and regular expressions.

3 languagesBeautifySize reportSafe mode
Languages
3
JS mode
Safe
Uploaded
0 B

Code Minifier & Beautifier

Runs in your browser · nothing uploaded
Source
Minified
Before
0 B
After
0 B
Saved
0%
Language
CSS

01 — How to use Code Minifier & Beautifier

1 Paste your code CSS, JavaScript or HTML. The language is detected from what you paste, and you can override it with the toolbar if the guess is wrong.
2 Choose a direction Minify strips comments and unnecessary whitespace. Beautify does the opposite: it re-indents compressed code so you can read it.
3 Check the size report The footer shows bytes before, bytes after and the percentage saved, measured in UTF-8 bytes rather than characters so the figure matches what a server would actually send.
4 Copy the result Copy output takes the whole result. Your code is never uploaded, which matters for anything unreleased or internal.

02 — Getting good results

JavaScript minification here is deliberately conservative Comments and indentation go, but line breaks stay. Joining lines in JavaScript is unsafe without fully parsing it: a return followed by a newline returns undefined, and pulling the next line up silently changes what the code does. Use a build-step minifier for maximum compression.
Minified output is not obfuscated Removing whitespace makes code smaller, not secret. Every name, string and URL is still there in plain sight, and beautifying it back is one click. Never minify something to hide a key.
Beautifying minified code cannot restore names If code was compressed by a real build tool, variables were already renamed to single letters. Re-indenting makes the structure readable again, but the original names are gone and no tool can bring them back.

03 — Questions

No. Every transform runs in this browser tab. Nothing is sent to a server, which is the point for unreleased or proprietary code.

04 — More about Code Minifier & Beautifier

61 more tools
where this came from.

Same shell, same shortcuts, same promise: nothing leaves your browser.

Browse all 62