JS/TS formatter — Prettier in your browser
Format JavaScript, TypeScript, JSON, CSS, HTML and Markdown with Prettier. It runs entirely in your browser (0 uploads, works offline).
How to use it
- Paste your code.
- Choose the language.
- Copy or Download the formatted code.
FAQ
How do I format JavaScript online for free?
Paste the code, pick the language, and this page runs Prettier to reformat it consistently — on your device with no upload.
Is my code uploaded anywhere?
No. Formatting runs entirely in your browser and nothing is transmitted or stored, which you can verify by turning off your Wi-Fi — safe for proprietary code.
Which languages are supported?
JavaScript, TypeScript, JSON, CSS, SCSS, LESS, HTML and Markdown, using Prettier's standalone build.
Why did it not format my code?
Prettier needs syntactically valid code. If there is a syntax error, it reports it so you can fix it and try again.
Limits
Formats with Prettier's defaults plus a couple of options; custom .prettierrc configs are not read here.
Related
The CSS/HTML/SQL formatters handle those languages; the JSON formatter tidies JSON.
Bookmark this page (Ctrl+D, or ⌘D on Mac) or install the app — it works offline the next time you need it.