Skip to content
Developer & CodeLocal · Stays on device

JavaScript Minifier

Minify JavaScript with terser: compress, shorten local names and keep licence comments, with exact syntax errors and size savings.

  • JavaScript (ES2024), ES modules, Classic scripts
  • Free to use
  • No sign-up or watermark
javascript-minifierOn this device
1
2
3
4
5
6
7
8
9
10
1
2
3
4
5
6
7
8
9
10
JavaScript (ES2024)ES modulesClassic scripts
Open JavaScript Minifier

About this tool

Uses terser, the minifier behind most modern build tools, loaded only when you open this page. Compress removes dead code and simplifies expressions; Shorten names renames local variables and function parameters (global names and object properties are left alone, so your public API keeps working). Licence comments marked /*! or @license are kept by default.

Tick ES module for code with import or export, which also lets top-level names be shortened. Syntax errors are reported with the exact line and column. The page shows the original, minified and gzipped sizes so you can see the real saving. The code is parsed and rewritten, never run. Everything runs in your browser. Your data is never uploaded, logged or stored.

  1. Input

    Your code or text

    JavaScript (ES2024), ES modules, Classic scripts

  2. Processing

    Processed in this browser

    In-browser. Nothing is uploaded.

  3. Output

    Your result

    Ready to download or copy

Local processing pipelineterser (BSD-2-Clause), loaded on demand

How to use it

  1. 1

    Paste your JavaScript.

  2. 2

    Choose compression, name shortening and module mode.

  3. 3

    Fix any syntax error, then copy or download the minified file.

Zero-upload architecture

How to use JavaScript Minifier for free, with no upload

Free, with no sign-up or watermark · Your files stay on your device

  1. 1

    Open JavaScript Minifier

    Launch the app and add your file. There is nothing to install and no account to create.

  2. 2

    Work through it

    Choose compression, name shortening and module mode.

  3. 3

    Get your result

    Fix any syntax error, then copy or download the minified file.

  • Local

    JavaScript Formatter

    Beautify minified or messy JavaScript with configurable indentation and brace style, plus a syntax check that parses the code without running it.

    Open tool
  • Local

    CSS Minifier

    Minify CSS for production with csso: remove whitespace and comments, shorten colours and values, and merge rules, with before/after and gzip sizes.

    Open tool
  • Local

    HTML Minifier

    Shrink HTML safely: remove comments and collapse whitespace while leaving pre, textarea, script and style contents untouched.

    Open tool
  • Local

    JSON Minifier

    Remove whitespace from JSON to make it as compact as possible, and see how much space you save.

    Open tool