Skip to content
Codesphere
← All tools
</>

Code Minifier

Minify JavaScript, CSS, and HTML with copyable output.

JavaScript is minified with Terser, loaded only when you use this tool.

Input
Invalid

Minifying...

About the Code Minifier

Minify JavaScript with Terser, or CSS and HTML with lightweight local minification, and see the byte savings. Terser loads only when you choose JavaScript, keeping the page light for CSS and HTML use.

How the result is produced

JavaScript uses a browser-loaded minifier, while CSS and HTML use local whitespace and comment transformations. The result pane reports output size and the approximate byte difference.

Example: A development JavaScript snippet can be minified for a quick size comparison before the production build runs its own bundler and optimizer.

Limitations and review notes

Minification is not transpilation, bundling, security review, or a replacement for tests. Preserve source maps and verify behavior because aggressive transformations can expose assumptions in unusual code.

How to use it

  1. 1. Choose JavaScript, CSS, or HTML.
  2. 2. Paste the source code into the input pane.
  3. 3. Review the minified output and byte savings.
  4. 4. Copy the result or download it as a file.

FAQ

Which languages can be minified?

JavaScript, CSS, and HTML. JavaScript minification uses Terser; CSS and HTML use lightweight local minification.

Is Terser loaded on every page?

No. Terser is dynamically loaded only when you minify JavaScript on this page, keeping other pages lightweight.

Does minification upload my code?

No. Minification runs entirely in your browser after the page loads.

Related tools

View category →

Was this useful?