Minify JavaScript code online — compress JS files, remove whitespace and comments
JavaScript minification removes extra whitespace, comments, and line breaks.
Reduces script size for faster page loading.
Shows compression statistics — character count before and after minification.
The "Format" button performs the reverse operation — adds indentation for easy reading.
JS Minifier Online — JavaScript Compression and Beautification
The JavaScript minifier removes comments, whitespace, and line breaks from JS code, reducing file size to speed up page loading. A beautify (format) function is also available for readable formatting of minified code.
What Gets Removed in JS Minification
- Single-line comments —
// comment - Multi-line comments —
/* ... */(except license comments/*! ... */) - Whitespace and indentation
- Line breaks — code becomes a single line
JavaScript Beautification
The "Format" button restores readability: adds 4-space indentation, line breaks after semicolons and braces, spaces around operators. Useful for reading third-party minified libraries.
Minification in Workflow
- Vite — built-in minification via esbuild (default) or Terser
- Webpack — TerserPlugin
- Rollup — @rollup/plugin-terser
Manual minification is suitable for small scripts, bookmarklets, and quick optimization without build configuration.
Frequently Asked Questions
Is minification safe?
Basic minification (no mangling) is completely safe. Mangling (variable renaming) may break code using eval() or dynamic property names.
Can TypeScript be minified?
No. First compile TS to JS, then minify the output.
How to debug minified code?
Use source maps — they link minified code to the original. Modern bundlers generate them automatically.
For CSS minification use the CSS minifier, for JSON formatting — JSON formatter.
Useful articles
WCAG Color Contrast: Website Accessibility Guide
A complete guide to color contrast: WCAG 2.1 standards, AA and AAA levels, calculation formula, practical examples of good and bad contrast, and how to fix accessibility issues.
CSS Border Radius: Rounding Element Corners
How to use border-radius: syntax, shorthand notation, elliptical corners. Online border-radius generator.