Prettier Playground

Format code with the real Prettier, right in your browser. Paste JavaScript, TypeScript, JSON, CSS, HTML, Markdown, YAML or GraphQL, and it's formatted as you type, with the language detected for you. Tweak print width, indentation, quotes, semicolons and trailing commas to match your project, then copy or download the result. Nothing is uploaded.

Languages and parsers

LanguageParser
JavaScript / JSXbabel
TypeScript / TSXtypescript
JSONjson
CSS / SCSS / Lesscss / scss / less
HTML / Vuehtml / vue
Markdownmarkdown
YAMLyaml
GraphQLgraphql

When to use it

  1. Tidy a snippet before pasting it into a PR or docs.
  2. Try Prettier options before adding a .prettierrc to a project.
  3. Format JSON or YAML config files quickly.
  4. Find a syntax error, with the exact line and column.

How to Use

  1. Paste your code.
  2. Check the detected language, and set width, indent, quotes and commas.
  3. Copy or download the formatted code.

Features

  1. Real Prettier 3
  2. 11 languages
  3. Auto-detect
  4. Formats as you type
  5. All main options
  6. Syntax errors with location
  7. Copy or download
  8. Never uploaded

FAQs

Is this the real Prettier?

Yes, Prettier 3's official standalone build, so output matches the CLI with the same options.

Which languages are supported?

JavaScript/JSX, TypeScript/TSX, JSON, CSS, SCSS, Less, HTML, Vue, Markdown, YAML and GraphQL.

How does auto-detect work?

It looks at the text's shape (tags, braces, YAML keys, headings, type annotations). If it guesses wrong, pick the language yourself.

Why do I get an error?

Prettier only formats valid code. The message shows the line and column where parsing failed.

Is my code uploaded?

No. Formatting runs in your browser.

Technical Details

This runs Prettier 3's standalone build in your browser. Only the parser plugins the chosen language needs are downloaded: Babel for JavaScript and JSON, TypeScript for TS, PostCSS for CSS, SCSS and Less, and so on. HTML and Vue also load the CSS and JavaScript parsers, so code inside <style> and <script> is formatted too. Auto-detect looks for signs such as a leading tag, valid JSON, YAML keys, Markdown headings, CSS rule blocks or TypeScript type annotations, and you can override it. Formatting re-runs 250 ms after you stop typing. Syntax errors are shown with Prettier's own line and column pointer. The options map directly to Prettier's: printWidth, tabWidth, useTabs, semi, singleQuote, trailingComma and bracketSpacing.

Developer Tools

Developer Tools

  • XML Formatter
  • cURL Command Builder
  • cURL to Code
  • HTTP Status Codes
  • Subnet Calculator
  • IP & MAC Validator
  • URL Parser
  • URL Query Builder