How to use Code Minifier
This is the Code Minifier utility. 100% client-side and offline capable.
Minify, beautify, and optimize your code locally - No API required
Learn what changes were made during minification
Process your code to see detailed explanations of optimizations
Each optimization step will be explained hereCheck for errors before processing
Process code to see side-by-side comparison
Upload multiple files to minify at once
Drag & drop files here or click to select
Supports: .html, .css, .js, .json, .xml, .php, .sqlYour processing history will appear here
History is saved locally in your browserThis is the Code Minifier utility. 100% client-side and offline capable.
Code minification is the process of removing unnecessary characters from source code without changing its functionality. This includes removing comments, whitespace, and line breaks. Minified code loads faster, reduces bandwidth usage, and improves website performance—critical for SEO and user experience.
Our Code Minifier supports HTML, CSS, JavaScript, JSON, XML, PHP, SQL, Python, and C/C++. Each language has specialized minification logic that understands its syntax, comment styles, and string preservation requirements.
100% Private. All minification happens locally in your browser using JavaScript. Your source code is never sent to any server. This makes it completely safe for processing proprietary code, passwords in config files, or any sensitive data.
Our minifier uses safe string and regex preservation to ensure your code remains functional. String literals, template literals, and regex patterns are extracted before processing and restored after. We recommend using the Validate tab before minifying to catch any syntax errors in your original code.
Minify removes all unnecessary characters to reduce file size—ideal for production deployment. Beautify does the opposite: it adds proper indentation, line breaks, and spacing to make minified or poorly formatted code human-readable—perfect for debugging or learning.
Yes! When processing HTML files, our tool automatically detects <style> and <script> tags and applies the appropriate CSS or JavaScript minification rules to their contents. This gives you comprehensive minification without needing to process files separately.
Results vary based on how much whitespace and comments your original code contains. Typically, you can expect 20-60% reduction for CSS and JavaScript files, and 10-30% for HTML. Well-commented development code sees the highest savings. Our stats panel shows you exact before/after comparisons.
Yes! Use the Batch Processing tab to upload multiple files at once. Drag and drop your files, click "Minify All," and download them individually or as a ZIP archive. This is perfect for preparing an entire project for production deployment.