Code Formatter

Beautify HTML, CSS, JavaScript, TypeScript, JSON, Markdown, YAML, GraphQL and XML with Prettier — entirely in your browser.

 

Formatting only changes whitespace and style, never the meaning of your code. The Prettier engine loads on first use and nothing is ever uploaded.

About the Code Formatter

A one-stop beautifier for the languages you deal with every day — HTML, CSS, SCSS, LESS, JavaScript, TypeScript, JSON, Markdown, YAML, GraphQL and XML. It is powered by Prettier, the widely used opinionated formatter, so the output matches what most modern projects already produce, with consistent indentation, wrapping and spacing.

Pick the language, set your indent width and, for the JavaScript family, your semicolon and quote preferences, and the code is reformatted in place. The Prettier engine and each language plugin are only downloaded when you first format that language, and everything runs on your device — your code is never sent to a server.

How to use it

  1. Paste your code.
  2. Select the language it is written in.
  3. Set the indent width, and for JS/TS choose semicolons and quote style.
  4. Copy the formatted result.

Good to know

  • Eleven languages: HTML, CSS, SCSS, LESS, JavaScript, TypeScript, JSON, Markdown, YAML, GraphQL and XML.
  • Powered by Prettier for output that matches common project setups.
  • Options for indent width, tabs, semicolons and quote style.
  • Plugins load on demand and formatting runs locally — nothing is uploaded.

Frequently asked questions

Which languages can it format?

HTML, CSS, SCSS, LESS, JavaScript, TypeScript, JSON, Markdown, YAML, GraphQL and XML. Each uses the appropriate Prettier plugin, which is fetched only the first time you format that language.

Will it change my code, or just its layout?

It only reformats — indentation, line breaks, quotes and spacing. It does not rewrite logic, rename anything or change behaviour, so the formatted code is functionally identical.

Is this the same as running Prettier locally?

It uses the same Prettier engine, so the results line up closely with a local Prettier run using default options. It is handy when you want a quick tidy-up without setting up tooling.

Is my code private?

Yes. Formatting runs entirely in your browser. Your source is never uploaded, so proprietary code is safe to paste.

Related tools