Format and beautify JavaScript with Prettier. Supports ES2022+, CommonJS, ESM, async/await, optional chaining, and template literals. 100% browser-based.
The JavaScript Formatter is a Prettier-powered, browser-based tool that instantly beautifies raw, minified, or inconsistently indented JavaScript into clean, standardised output. Using Prettier's Babel parser with the estree plugin, it handles the full modern JavaScript language surface — ES2022+, CommonJS and ESM modules, async/await, optional chaining (`?.`), nullish coalescing (`??`), class fields, and template literals — with configurable indentation. All formatting runs in a Web Worker so even large files process without blocking the page. Your code never leaves the browser.
QWhich version of JavaScript does this support?
ES2022 and below, including all stage-4 proposals adopted in ES2022 such as class static blocks, at(), and Object.hasOwn(). Experimental stage-3 proposals may not be supported.
QWhat are the default formatting settings?
Prettier defaults: print width 80, double quotes, semicolons enabled, 2-space indentation. You can change the indent size with the indentation picker.
QIs my code sent to a server?
No. All formatting runs locally in a Web Worker inside your browser. Nothing is transmitted to any server.
QWhat is the difference between the JavaScript and TypeScript formatters?
The JavaScript formatter uses Prettier's Babel parser, which handles plain JS. The TypeScript formatter uses Prettier's TypeScript parser, which preserves type annotations, generics, decorators, and TypeScript-specific syntax.