Code Minifier
Minify HTML, CSS, JavaScript, JSON, XML, SVG and SQL to reduce file size.
100% Private — Nothing is Uploaded
All processing happens locally in your browser. Your files never leave your device and are never sent to any server.
Browse by language
About the Code Minifier
This tool reduces the size of your files by removing comments, collapsing whitespace, and stripping unnecessary characters — without changing how the code behaves.
Supported languages
- HTML — preserves content inside
<pre>,<textarea>,<script>, and<style>. - CSS — removes comments, collapses whitespace, shortens hex colors.
- JavaScript — safe tokenizer that respects strings, template literals and regex literals.
- JSON — produces the smallest valid JSON with full validation.
- XML — collapses whitespace between tags while preserving CDATA and text content.
- SVG — smaller vector graphics that render identically.
- SQL — removes comments, collapses whitespace, keeps strings and identifiers intact.
Why minify code?
- Smaller files — faster downloads.
- Better Core Web Vitals — improved page speed scores.
- Lower bandwidth costs — every KB counts.
- Cleaner config files — compact data files are easier to embed.