JavaScript & CSS Formatter

Pick a language, paste your code and press “Format code”.

Your text and files never leave your browser — nothing is sent to a server.

How to use

  1. Choose JavaScript, TypeScript, CSS, SCSS, LESS or JSON under “Language”.
  2. Paste your code and press “Format code” to fix indentation and line breaks. Minified one-line code is expanded into readable form.
  3. Use “Semicolons” and “Single quotes” to match your team’s style. The semicolon option only applies to JavaScript and TypeScript.
  4. If the syntax is wrong, the problem line is shown with a ^ marker and the status line gives the line and column.

FAQ

Which formatting rules are used?

It runs Prettier, the open-source formatter (MIT license), in your browser, so the output closely matches Prettier in your editor. The first time you pick a language, its formatter module may take a moment to download.

Can it minify code instead?

This tool expands code for readability. To shrink files, use the JS & CSS Minifier.

Is my code sent to a server?

No. Everything is processed in your browser and nothing is uploaded.

Related tools

All tools