How to minify code
- Pick JavaScript, CSS or HTML, and paste your code.
- Choose Minify. You’ll see how much smaller it got.
- Copy the result, or download it as a file.
Making a site faster? Shrink your pictures with Compress image, and check your share previews with the Open Graph checker.
Frequently asked questions
What does minifying do?
It removes what browsers don't need, like spaces, line breaks and comments, and (for JavaScript) shortens local variable names. The code works the same but downloads faster.
Is it safe for my code?
JavaScript is minified with Terser, the minifier used by most build tools. CSS and HTML minifying only removes comments and extra spaces, and leaves text in strings, <pre> and <textarea> exactly as it is. Keep your original files: minified code is hard to edit.
Which JavaScript does it support?
Modern JavaScript (ES2023), including modules, classes, async functions and optional chaining. It doesn't transform TypeScript or JSX; compile those first.
Is my code uploaded?
No. Everything is minified in your browser.