Prettier Code Formatter & Colorizer

Use the Prettier Code Formatter & Colorizer to reformat and beautify your code. Paste your code, pick the language and options, and the formatted, syntax-highlighted result appears as you type. Everything runs in your browser; your code is not uploaded.

About This Tool

How to Use
  1. Paste your code into the input area
  2. Select the language and options (indent, line width, semicolons, quotes)
  3. The code is formatted as you type; press Ctrl+Enter to format at once
  4. Copy the formatted code or download it as a file
Common Use Cases
  • Formatting code consistently before committing to version control
  • Cleaning up messy code copied from Stack Overflow or AI
  • Standardizing code style across team members
  • Making minified code readable for debugging
Tips & Tricks
  • Prettier is opinionated: it enforces one consistent style automatically
  • Supports JavaScript, TypeScript, JSON, HTML, CSS, Markdown and GraphQL
  • If your code has a syntax error, the error message shows the line and column
  • Everything runs in your browser; your code is not uploaded

Related Tools