Minify JS

Minify JavaScript, CSS, HTML, JSON, SVG, and XML with configurable options and file upload

Minify JS
Options
JavaScript Input
Loading editor...
Minified Output
Drop a JavaScript file here, paste code in the editor,
or click the button below to upload
Supports .js,.mjs,.cjs,.jsx,.ts,.tsx

Free Online Minify JS

Minify JS is a browser-based code compression tool that reduces the file size of your JavaScript by stripping comments, collapsing whitespace, removing console statements, and optionally shortening variable names. We built six minification utilities into one workspace so you can also minify CSS, HTML, JSON, SVG, and XML without switching between different tools. Paste your code into the editor, upload a file from your computer, or drag and drop it onto the workspace. A circular gauge instantly shows how much space you saved and all processing happens locally in your browser so your code never leaves your device.

Minify JS

Strips comments and whitespace from JavaScript with options to drop console calls and shorten variable names for deeper compression.

Minify CSS

Removes comments, collapses whitespace, and strips trailing semicolons to produce a single-line production stylesheet.

Minify HTML

Removes HTML comments and collapses whitespace between tags for a smaller document that renders identically.

Minify JSON

Parses and re-serializes JSON without indentation or whitespace. Validates input and reports errors for malformed JSON.

Minify SVG

Removes comments, strips the XML declaration, and collapses whitespace for smaller SVG files that render the same way.

Minify XML

Strips comments and inter-element whitespace from XML while preserving CDATA sections, namespaces, and processing instructions.

Online Minify JS with Compression Gauge and File Upload

Unminified JavaScript files ship with comments that developers wrote for their own reference, indentation that makes the code readable in an editor, and debug statements like console.log that serve no purpose in production. Every extra byte adds to download time, especially on mobile networks where latency is high and bandwidth is limited. Our online Minify JS tool solves this by running multiple compression passes on your code and showing the results in real time with a circular gauge that displays exactly how much smaller your file became.

Upload Files From Your Computer

You can load code into the workspace three ways: paste it into the code editor on the left, drag and drop a file anywhere onto the workspace, or click the Upload File button. For JavaScript, we accept .js, .mjs, .cjs, .jsx, .ts, and .tsx files. Each sub-tool accepts the file types relevant to its language. Because everything runs in your browser, there is no file size limit imposed by a server and your code never leaves your machine.

Configurable JavaScript Minification

The JavaScript minifier gives you four toggle switches that control the compression behavior. Remove Comments strips both single-line (//) and block (/* */) comments. Collapse Whitespace joins lines and removes redundant spaces around operators and braces. Drop Console removes every console method call including log, debug, info, warn, error, trace, dir, table, time, timeEnd, group, groupEnd, count, assert, clear, profile, and profileEnd. Shorten Variables renames local identifiers to single-character names for additional size reduction.

Minify CSS, HTML, JSON, SVG, and XML in One Workspace

Most projects use more than just JavaScript. Stylesheets, markup, data files, and vector graphics all benefit from minification. Instead of finding a separate tool for each format, you can switch between six minifiers using the sidebar. The CSS minifier collapses whitespace around selectors and properties and strips trailing semicolons. The HTML minifier removes comments and collapses inter-tag whitespace. The JSON minifier parses and re-serializes without indentation, and it validates your input so you know immediately if the JSON is malformed. The SVG minifier strips comments, removes the XML declaration, and cleans up attribute spacing. The XML minifier removes comments and inter-element whitespace while preserving CDATA sections and namespace declarations.

Real-Time Compression Metrics

Every time you change the input or toggle an option, the output updates automatically. A compression gauge above the minified output shows the percentage saved as a filled ring. Beside it, you see the original size, minified size, saved bytes, line count reduction, and the number of comments stripped. These metrics help you understand exactly what the minifier did and how much bandwidth each optimization saves.

Your Code Stays Private in Your Browser

We process everything locally using JavaScript in your browser. No server requests, no cookies, no account required. You can safely minify production bundles, proprietary libraries, API responses with sensitive data, and internal configuration files knowing that nothing is transmitted anywhere. The workspace works offline once loaded.

Related Free Developer and Minification Tools

If you work with code minification regularly, these tools complement what you can do here:

What Users Say

Rated 4.8 out of 5 based on 144+ verified user reviews

L

Linkon Patrick

US · Jun 14, 2026

★★★★★

This app is over good to use thanks

M

Mike Baker

US · Jun 12, 2026

★★★★☆

Nice service, seems to be free to use, by watching a short ad. Seems to work as it should.

N

Neetu Parihar

IN · Jun 3, 2026

★★★★★

Awesome tool and great work by developers and the team. Salute to your hardwork and dedication dudes.

A

Artos Publishing

RS · May 22, 2026

★★★★★

The Aifreeforever is simple and easy to use. From the start I didn't have any problems. Especially, I like the opportunity to work with ChatGPT 5 with no limitations.

C

Curtis Baker

US · May 2, 2026

★★★★★

With all these ridiculous prices on the over hyped AI competitors. I can't thank you, Aifreeforever, enough! Thank you for looking out for "We The People!"

M

Mohsen

IR · Jun 10, 2026

★★★★★

it was best experience

Share Your Comments & Feedback

Have a suggestion or want to share your experience? We would love to hear from you.