Free Code Minifier & Beautifier
Minify (strip comments and whitespace) or beautify (re-indent) HTML, CSS, or JavaScript.
Frequently Asked Questions
Is minify mode safe for real code, not just simple snippets?
It's built to be safe rather than aggressive: it only strips comments and collapses whitespace — it never renames variables or restructures logic. It correctly distinguishes strings, template literals, and regular expressions from comments (so it won't mangle a URL containing "//" or a regex containing "/"). For very obscure edge cases — like a string holding a stray curly brace immediately followed by a nested template literal — always sanity-check the output before shipping it. For a production build pipeline, a dedicated bundler/minifier is still the right tool.
Does beautify fully reformat my code like a linter would?
It re-indents based on brace and tag nesting, which makes minified or poorly-formatted code readable again. It doesn't apply a full style guide (line-wrapping, operator spacing, quote style) the way a tool like Prettier does.
What happens to comments in HTML's <script> and <style> tags?
In HTML mode, the content inside <pre>, <script>, <style>, and <textarea> tags is preserved exactly as-is — only HTML comments and whitespace between other tags are touched, so embedded JS/CSS isn't affected by HTML-mode processing.
Is my code sent anywhere?
No. Everything runs entirely in your browser. Nothing is uploaded or stored.