Paste your JavaScript code into the input area on the left, or upload a .js file using the upload button. You can also drag and drop a file directly onto the input area.
Click the Format button or press ⌘⇧F to beautify your JavaScript with Prettier, or Minify (⌘⇧M) to compress it with Terser for production deployment.
Customize formatting options: choose indentation (2 spaces, 4 spaces, or tabs), set print width, configure trailing comma style, and toggle semicolons and quote styles.
For minification, configure options like ECMA target (ES2015-ES2022), enable/disable mangling, compression, console removal, and license comment preservation.
Use Validate (⌘⇧V) to check your JavaScript for syntax errors. The validator shows error locations with line and column numbers for quick debugging.
Copy the output with the Copy button, download as a .js file, or use Share to generate a gzip-compressed shareable URL for code reviews.
Enable Auto Format to automatically beautify your code as you type (with 300ms debounce for smooth typing experience).
JavaScript formatter powered by Prettier with customizable indentation: 2 spaces, 4 spaces, or tabs to match your project's coding standards.
Configurable print width to control line wrapping for formatted code (default 80, adjustable 20-200 characters).
Trailing comma options: none, ES5, or all — automatically add or remove trailing commas in objects, arrays, and function parameters.
Quote style control: choose between single quotes or double quotes for string literals with automatic escaping.
Semicolon insertion toggle: automatically insert semicolons based on Prettier's rules or rely on ASI (Automatic Semicolon Insertion).
JavaScript minifier powered by Terser: compress code by removing whitespace, comments, and performing dead code elimination for smaller bundle sizes.
Variable name mangling: shorten variable and function names to obfuscate and reduce file size while preserving functionality.
ECMA target selection: specify JavaScript version target (ES2015/2016/2020/2022) for compatibility with older browsers or environments.
Console removal option: strip all console.log, console.error, console.warn, and other console statements for production builds.
Keep names option: preserve function and class names during minification for easier debugging in production error stacks.
Compress toggle: enable or disable Terser's compression passes (dead code removal, constant folding, etc.) for granular control.
License comment preservation: keep copyright and license comments in minified output when required by open-source licenses.
JavaScript syntax validator: detects parse errors, unclosed brackets, invalid tokens, and malformed expressions with line/column positions.
Error line highlighting: when syntax errors are detected, the offending line is highlighted in the input editor for quick identification.
Syntax highlighting with color-coded strings, keywords, numbers, literals, and comments for improved readability.
Auto-format with debounce: automatically format your code as you type with 300ms debounce to prevent input lag during rapid typing.
Race condition protection: generation counter ensures only the latest formatting/minification result is applied when options change rapidly.
JavaScript statistics: line count, byte size, and compression percentage displayed as meta badges for quick insights.
Shareable URLs: gzip-compresses your JavaScript into a URL parameter so you can share code snippets with teammates or save for later.
Works entirely in your browser — no JavaScript is ever sent to any server. Your code stays completely private.
Keyboard shortcuts for power users: ⌘⇧F to format, ⌘⇧M to minify, ⌘⇧V to validate, ⌘⇧K to clear.
Large-input warning with byte count — alerts you when the input may slow down processing due to file size.
Supports React, Vue, and other frameworks: the Babel parser handles JSX, modern JavaScript features, and experimental syntax.