Home › Developer Tools › Code Beautifier

Code Beautifier & Formatter

Turn minified or messy code into clean, consistently indented code with Prettier, right in your browser.

Open a code file or paste below

How to use Code Beautifier

  1. Paste your code or open a file; the language is detected for you.
  2. Pick indent, line width and JavaScript style options.
  3. Copy the formatted code or download it.

Powered by Prettier

This tool uses Prettier, the formatter used by millions of developers, so the output follows the same style as most modern projects. It supports HTML (with inline CSS and JS), CSS, SCSS, LESS, JavaScript and JSX, JSON, YAML and Markdown.

Unminify code

Paste a minified file (one long line) and get it back with line breaks and indentation, which makes it possible to read and debug. Comments and original names removed by minifiers can't be restored.

When formatting fails

Prettier only formats valid code. If it finds an error, you see the line and column so you can fix it. If detection picked the wrong language, choose it from the list.

Frequently asked questions

Is my code sent anywhere?

No. Prettier runs entirely in your browser.

Can it format TypeScript?

Not yet; use JavaScript mode for plain JS and JSX.

Why did my HTML spacing change?

Whitespace between tags is reformatted for readability; use the HTML Minifier for the smallest file.

Is it free?

Yes, with no limits.

Related tools

More Developer Tools