Code Beautifier: Format HTML, CSS & JavaScript

Clean up messy code in one click. Paste HTML, CSS, SCSS, JavaScript, TypeScript, JSON, Markdown or YAML, and get neatly formatted code using Prettier, the formatter used by millions of developers.

Formatting by Prettier 3.3.3, running in your browser.

Runs in your browser. Nothing you enter is sent or saved.

How to beautify code

  1. Paste your code into the box.
  2. Leave the language on Detect automatically, or pick it yourself.
  3. Choose indentation, line width, quotes and semicolons if you like.
  4. Click Beautify code or press Ctrl+Enter (⌘+Enter on Mac). Copy or download the result, or click Undo to get your original back.

Features

  • Nine languages: HTML, CSS, SCSS, Less, JavaScript and JSX, TypeScript, JSON, Markdown and YAML.
  • Automatic language detection that you can override.
  • Formatting by Prettier 3, so the output matches what most teams use in their editors.
  • Helpful errors: if the code can’t be parsed, you’ll see the line and column of the problem.
  • Private: your code is formatted in your browser and never uploaded.

Frequently asked questions

What is Prettier?

Prettier is a popular open-source code formatter. It rewrites code in a consistent style, so formatting stops being something people argue about in code reviews.

Does beautifying change what my code does?

No. It only changes spacing, line breaks, quotes and similar style details. The behavior of the code stays the same.

Why does it say it couldn’t format my code?

The code has a syntax error, or the wrong language was detected. Check the line it points to, or pick the language from the menu.

Is there a size limit?

There’s no fixed limit. Very large files may take a few seconds, because formatting runs on your device.

Need a custom version of this tool or an API for your business? Get in touch.