Code formatter
Format HTML, CSS, JavaScript, TypeScript, JSON, Markdown and YAML with Prettier, right in your browser, with indent and quote options.
Runs in your browserNothing uploadedWorks offline
Loading Code formatterRuns on this device. Nothing is uploaded.
Questions
Is this the real Prettier?
Yes. It runs Prettier's official standalone build with its parsers for each language, so the output matches Prettier with the same options. The parsers load the first time you format.
Why does it say my code has an error?
Prettier has to parse code before it can lay it out, so it stops on syntax errors and reports the line and column. Fix that spot, or check that the right language is selected.
Is my code uploaded?
No. Formatting happens in your browser and the page makes no network requests with your code.
Related tools
All developer toolsDeveloperjs mjs cjsHTML formatterBeautify minified or messy HTML with Prettier, inline <style> and <script> blocks included, right in your browser.Developerjs mjs cjsJavaScript formatterBeautify JavaScript with Prettier, with your choice of indent, line width, semicolons and quote style.Developerjson geojson plainJSON formatter and validatorFormat, validate and minify JSON, see the exact line and column of any error, and explore it as a collapsible tree.Developerjs mjs cjsCSS formatterBeautify minified or messy CSS with Prettier: one declaration per line, consistent spacing, media queries indented.Developerjs mjs cjsTypeScript formatterBeautify TypeScript with Prettier, types, interfaces and generics included, with your indent and quote style.DeveloperBase64 encode and decodeEncode text or any file to Base64 and decode Base64 back to text or the original file, with a URL-safe option.