HTML, CSS & JavaScript Formatter (Prettier)

Beautify HTML, CSS, JavaScript, TypeScript and JSON with Prettier, running entirely in your browser. Free, no sign-up, and your files never leave your device.

Free, with no sign-up and no watermark. The file is processed in your browser and never uploaded.

Beautify HTML, CSS, SCSS, Less, JavaScript, TypeScript, JSON, Markdown and YAML using Prettier — the same formatter many teams use in their editors — running entirely in your browser. Choose indentation, line width and, for JavaScript, semicolons and quote style.

Step by step

  1. Choose the language: Pick it from Language; the sample changes to match.
  2. Paste code: Or open a file.
  3. Adjust style: Indent, Line width, and for JS/TS Semicolons and Single quotes.
  4. Copy or download: The formatted code updates as you type.

Handy for

Minified code

Make third-party or minified code readable.

Emails and templates

Tidy hand-written HTML templates.

Consistent style

Apply Prettier style without installing anything.

Snippets for docs

Format code before pasting it into documentation.

Good to know

  • Syntax errors are reported with line and column — Prettier refuses to format code it can't parse.

  • HTML formatting also formats embedded <style> and <script> blocks.

  • The formatter downloads once (a few hundred KB) the first time you use it, then works offline.

Questions

Will it change how my code behaves?

Prettier only changes formatting. In HTML, whitespace between inline elements can matter visually; Prettier is careful to preserve meaningful whitespace.

Is my data sent anywhere?

No. Everything is processed by JavaScript in your browser tab — nothing you paste or open is uploaded, logged or stored on a server. You can even use the tool offline once the page has loaded.

More Developer Tools tools

All Developer Tools tools