creatorvalet

JavaScript minifier

Remove representation bytes without executing, renaming, folding, or deleting your code.

  • SECURE
  • NO UPLOADS
  • NO SIGNUP
  • BROWSER BASED
  • FREE
  • FOREVER.

Support us with a link or a share

Waiting for JavaScript
Input
Grammar
Script
Execution
Never
Grammar

Printer only: compression and name mangling are off. JSX, TypeScript, source maps, bundling, and code execution are not part of this run.

LOCAL-7711Parser-gated receipt

Your minified code appears here

The worker loads only after you choose Minify. Input and output must both parse under the grammar you selected before any result is shown.

A JavaScript minifier should make a smaller representation, not a bolder promise

This JavaScript minifier removes comments and whitespace that the selected grammar does not need. It does not execute your program, rename variables, fold expressions, remove branches, reorder statements, bundle imports, or claim that every possible runtime will behave identically. That narrower contract matters because “minification” is often used as one name for several very different operations.

Compression changes a program based on assumptions about values and side effects. Mangling changes binding names and may need property rules. Obfuscation deliberately makes code harder to inspect. This page does none of those. Terser is used as a parser and printer with both compression and mangling switched off. A second parser, Acorn, reads the source before the run and reads the printed result afterwards. If either parse fails, or their normalized structures differ, the result is withheld instead of being presented as a successful optimization.

A printer may choose a shorter equivalent spelling for a number, quote style, or pair of parentheses as well as removing comments and whitespace. The receipt therefore calls the result a parser/printer representation, not a whitespace-only rewrite. Raw literal spelling, source positions, and redundant empty statements in statement lists are normalized before the structural comparison.

Choose Script or Module before you minify JavaScript

A classic script and an ECMAScript module are not interchangeable grammar modes. Static import and export declarations belong to modules. Top-level await also requires Module mode. Modules are strict by definition, while a classic script is strict only when it contains the appropriate directive. The tool asks you to choose because silently trying both would hide which rules your actual runtime applies.

CommonJS files using require and module.exports are normally classic scripts. Browser files and modern package source that use static imports are modules. Choose the same mode as the environment that will load the file. A syntax error includes a line and column when the parser provides them, so a wrong selection is visible rather than repaired by guessing.

Why whitespace can be JavaScript syntax

Removing spaces with a regular expression is unsafe. A slash can begin a regular expression or mean division. A newline after return can end the statement. Joining two tokens can turn separate identifiers into one, and a line beginning with (, [, or a template literal can attach itself to the previous expression. Hashbangs and directive prologues also occupy syntax-sensitive positions. A real parser tracks those boundaries; a search-and-replace pattern does not.

The independent structural check is useful evidence, but it is not a proof of program meaning. JavaScript can depend on host APIs, timing, proxies, module resolution, engine versions, and effects no static tree comparison can observe. Keep tests and a readable source file in version control. Treat the minified file as a generated delivery artifact, not as the only copy of your work.

What this local tool deliberately leaves out

JSX and TypeScript are different input languages and are rejected rather than partially understood. Source maps are not emitted because a trustworthy map needs its own source-to-output verification. Multiple files are not resolved or bundled. Class names, property names, imports, exports, and strings are not rewritten. If the material you have is a data object rather than a program, the JavaScript object to JSON converter has the narrower data-only parser. If it is already JSON, the JSON formatter can validate, format, or minify that grammar directly.

Source and output stay in this tab. The parser worker is downloaded from CreatorValet only after you press Minify, then it processes the text locally. There is no upload route, analytics payload, eval, new Function, script injection, or dynamic import of your pasted code. Copy and download use the complete result even when the on-page preview is shortened for a very large file.

Questions

Does this JavaScript minifier run the code I paste?

No. Your text is parsed as source code inside a local worker and printed back in a smaller representation. It is never passed to eval, new Function, a script element, an import call, or a server. Calls, getters, imports, network requests, and every other operation remain inert text throughout the process.

What is the difference between Script and Module mode?

Module mode accepts static import and export declarations and top-level await, and JavaScript modules are always strict. Script mode is for classic scripts, CommonJS-style files, and snippets without module syntax. The tool does not guess because code can parse differently under the two grammars; choose the same mode your runtime uses.

Does it compress or mangle variable names?

No. Compression and mangling are deliberately disabled. Those optimizations can fold expressions, remove code, change ordering assumptions, or rename bindings and properties. This route asks a parser/printer for a compact representation, which can also choose shorter equivalent spellings for literals, quotes or parentheses, then checks the result with an independent parser.

Does the parser check prove the program behaves identically?

No. The check is a narrow structural guard, not a mathematical or runtime proof. It catches syntax errors and structural differences introduced while printing, including many separator and automatic-semicolon-insertion mistakes. It cannot prove every effect a JavaScript program may have in every engine, so the tool makes no semantic-equivalence claim.

Does it support TypeScript, JSX, source maps, or bundling?

No. The accepted input is modern JavaScript under the selected Script or Module grammar. TypeScript and JSX need different parsers and output contracts. Source maps require verified source-to-output mappings, and bundling resolves files and package rules; neither is silently approximated here.