Code Formatter
Format JavaScript, TypeScript, HTML, CSS, JSON, Markdown, YAML and GraphQL with Prettier. Runs in your browser.
Runs in your browser. Your input is never uploaded.
How to use it
- Paste your code, or press Ctrl+Enter after pasting.
- Leave the language on Auto-detect, or choose it yourself for the best result.
- Pick indent, line width, semicolons and quote style.
- Press Format code and copy the result.
Want to learn more? Read Prettier explained: why format your code?.
FAQ
- Which languages are supported?
- JavaScript, JSX, TypeScript, JSON, HTML, CSS, SCSS, Less, Markdown, YAML and GraphQL. Python, Java and PHP need extra Prettier plugins that this tool does not include.
- Why does it show an error?
- Prettier must be able to parse your code. A missing bracket or quote is the usual cause, and the message names the line.
- Is my code uploaded?
- No. Prettier runs in your browser. Only the formatter files are downloaded.
- Why does the first format take a moment?
- The Prettier files load the first time you press Format, so the page stays fast until you need them.