Minify JavaScript by stripping comments, collapsing whitespace and compressing code for production. Reduces bundle size instantly.
No output yetA JavaScript minifier is a build optimization tool that reduces the file size of your JavaScript code by removing everything that is not needed for execution. This includes single-line comments (//), multi-line comments (/* */), excess whitespace, line breaks, and unnecessary spacing around operators and punctuation. The result is a compact, single-line script that browsers parse and execute faster. Minified JavaScript directly improves page load performance by reducing download size and parse time, which positively impacts Core Web Vitals metrics like First Contentful Paint (FCP) and Time to Interactive (TTI). Professional build tools like Webpack, Vite, and Rollup include minification as a production step, but this free online JavaScript minifier lets you quickly compress individual scripts without setting up a build pipeline. All processing happens in your browser — nothing is uploaded to a server, so your source code stays completely private.
Copy your JavaScript code from your editor or file and paste it into the input field. The tool accepts any JavaScript including functions, classes, modules, and ES6+ syntax.
The minified result appears instantly below the input. Single-line and multi-line comments are stripped, whitespace is collapsed, and operator spacing is compressed into the smallest possible output.
Review the character count comparison showing original size, minified size, and percentage saved. Click Copy to grab the minified code for use in your production build or CDN deployment.
Pretty-print and validate JSON with 2 / 4 space indentation.
Convert JSON arrays to CSV format. Auto-detects columns, proper escaping, download as .csv.
Convert CSV data to a JSON array of objects. Handles quoted fields and commas.
Beautify messy HTML with proper indentation or minify it for production.
Minify HTML by stripping comments, collapsing whitespace. Shows size savings.
Beautify CSS with proper indentation or minify it for production. Strips comments.