Skip to content
Shrake DevTools
  • JSON FormatterData & Format
  • JSON ValidatorData & Format
  • JSON MinifierData & Format
  • JSON ↔ YAML ConverterData & Format
  • XML FormatterData & Format
  • Base64 Encoder / DecoderData & Format
  • URL Encoder / DecoderData & Format
  • JWT InspectorData & Format
↑ ↓ to navigate↵ to openEsc to close

JavaScript Formatter / Minifier

Runs locally in your browser. Your input is not uploaded.Free, no sign-up

Input

Output

Format JavaScript, JSX and TypeScript, or minify JavaScript, without executing it.

How to use the JavaScript Formatter and Minifier

  1. Paste JavaScript, JSX or TypeScript and pick the Language, or click Sample.
  2. Choose indentation, quotes and semicolons; the formatted code appears instantly.
  3. Switch to Minify to shrink JavaScript for production and see the savings.
  4. Syntax errors are shown with their line and highlighted in the editor.

Your code is never run

Formatting and minifying only parse and rewrite the text. Nothing you paste is executed, so it's safe to paste code you don't trust, such as a suspicious script you're investigating.

Minify options

  • Shorten names renames local variables and functions (message → e). Global names in a script stay, because other scripts may use them; in an ES module (code with import or export) top-level names are shortened too.
  • Compress rewrites code into shorter equivalents, such as removing unreachable code and folding constants.
  • Keep license comments keeps /*! … */, @license and @preserve comments, as most licenses require.

Frequently asked questions

Which tools does this use?

Prettier for formatting and Terser for minifying, the same tools most build pipelines use, running in your browser.

Can I minify JSX or TypeScript?

Not directly. Compile it to JavaScript first (for example with your bundler), then minify the result.

Is my code uploaded?

No. Everything happens in your browser.