How to use the JavaScript Formatter
- Paste JavaScript or TypeScript, or open a file.
- Choose the language and style options.
- Copy or download the formatted code.
Powered by Prettier
The formatter runs Prettier — the most widely used JavaScript formatter — directly in your browser. It supports modern syntax (ES2024+, JSX, TypeScript including generics and decorators) and prints code in a consistent, widely accepted style.
Reading minified code
Formatting a minified bundle restores line breaks and indentation, which makes it much easier to follow. Variable names shortened by a minifier can't be restored, though — that would require the source map.
Private by design
Code is formatted locally; nothing is uploaded. Prettier is loaded only when you open this page, so other Expensico tools stay fast.
Frequently asked questions
Why are there so few options?
Prettier is intentionally opinionated: a small set of options keeps code consistent across teams. The most commonly changed ones are offered here.
Can it minify JavaScript?
No. Minifying JavaScript safely requires a full minifier like Terser or esbuild, which belongs in your build process.
Is what I enter stored or sent anywhere?
No. Calculations and processing happen in your browser. Nothing you type is sent to our servers. Some tools remember your last input in this browser's local storage for convenience; you can clear it at any time.