JavaScript Minifier

Minify JavaScript code online for free. Remove comments, whitespace, and optimize your JS files for faster page loading.

Processed locally; inputs are not sent to a server. Input is limited to 1 MiB; processing stops after 10 seconds.

Options

With compact whitespace off, output is formatted; original spacing is not retained. Protected comments (@license, @preserve, !) are kept.

This deliberately suppresses console output, while evaluating the callee and arguments. Assumes a standard console. Local bindings, aliases, computed calls and other methods stay unchanged. Optional console calls, eval, with and explicit logger writes are refused; disable this option for those programs.

Original
Minified
Saved
Bytes Saved

Negative savings mean the generated result is larger.

Method and limits

Transform JavaScript locally without running it. Babel 7.28.5 (MIT).

Standard JavaScript script/module syntax, tested through ES2022: private class members, optional chaining and top-level await. No transpilation, TypeScript or JSX. Input is never executed.

JavaScript Minifier

This free online JavaScript minifier reduces file size by removing comments, whitespace, and shortening boolean values. Improve your website performance by serving minified JS files. Supports syntax-safe minification that preserves string literals.

Copied

Copy failed. Select the result and copy it manually.

Embed this tool on your website

Use whole pixel dimensions from 1 to 4096.

ร— px (1โ€“4096)

                        

๐Ÿ’ก Integration Tip

Copy the embed code and paste it into your website HTML. The responsive version adapts to all screen sizes automatically.

1 rating
โœ“

Popular Tools

No more tools to show
Explore All Tools

About JavaScript Minifier

Transform JavaScript locally without running it. Standard JavaScript script/module syntax, tested through ES2022: private class members, optional chaining and top-level await. No transpilation, TypeScript or JSX. Input is never executed. With compact whitespace off, output is formatted; original spacing is not retained. Protected comments (@license, @preserve, !) are kept. This deliberately suppresses console output, while evaluating the callee and arguments. Assumes a standard console. Local bindings, aliases, computed calls and other methods stay unchanged. Optional console calls, eval, with and explicit logger writes are refused; disable this option for those programs. Input is limited to 1 MiB; processing stops after 10 seconds.

Example: const a=1,b=2; a + +b; keeps the value 3. Format changes layout, not execution.

Page modification dates describe editorial changes, not external or legal verification.

Use Cases

Developers and QA engineers inspecting, validating, or transforming data using the Js Minifier.
DevOps practitioners debugging configuration files, tokens, or API responses on the fly.
Students learning web development, data formats, or encoding schemes with a hands-on Js Minifier.
Technical writers preparing code samples, configuration examples, or documentation assets.
Security researchers and bug bounty hunters who need a quick sandbox without CLI access.

How to use

1

Paste JavaScript into Input, or load the sample.

2

Select the options for Minify; Format ignores these options and preserves comments and boolean expressions.

3

Click Minify or Format. Editing input or options clears the result; click an action again to update it.

4

Standard JavaScript script/module syntax, tested through ES2022: private class members, optional chaining and top-level await. No transpilation, TypeScript or JSX. Input is never executed.

5

Read the Output and size statistics. Negative savings mean the output is larger.

6

Copy or download the current successful output.

Pro Tips

  • Standard JavaScript script/module syntax, tested through ES2022: private class members, optional chaining and top-level await. No transpilation, TypeScript or JSX. Input is never executed.
  • Use keyboard shortcuts (Ctrl/Cmd+A to select all, Ctrl/Cmd+C to copy) to speed up your workflow inside the Js Minifier.
  • Input is limited to 1 MiB; processing stops after 10 seconds.
  • The Js Minifier does not log or store your input. If you need history, copy important outputs to a local file or note app.
  • Combine the Js Minifier with other tools on this site (formatters, converters, encoders) to build complete data pipelines without leaving your browser.

Frequently Asked Questions

Free to use without signup or API key. Each input is limited to 1 MiB UTF-8 and processing to 10 seconds.

No. The Js Minifier runs entirely client-side in your browser. Your input never touches our servers.

Input is limited to 1 MiB; processing stops after 10 seconds.

Yes. Outputs generated with the Js Minifier are yours to use freely in any personal or commercial project.

The local engine loads when you first run an action. Network access may be needed to load it or reload the page; offline availability and cached assets are not guaranteed.

Free to use without signup or API key. Each input is limited to 1 MiB UTF-8 and processing to 10 seconds.

Standard JavaScript script/module syntax, tested through ES2022: private class members, optional chaining and top-level await. No transpilation, TypeScript or JSX. Input is never executed. With compact whitespace off, output is formatted; original spacing is not retained. Protected comments (@license, @preserve, !) are kept. This deliberately suppresses console output, while evaluating the callee and arguments. Assumes a standard console. Local bindings, aliases, computed calls and other methods stay unchanged. Optional console calls, eval, with and explicit logger writes are refused; disable this option for those programs.

Transform JavaScript locally without running it. Processed locally; inputs are not sent to a server.

FreeWebTools AI