Prettier options

width 80 / 2 spaces / semicolons / double quotes / trailing es5 / bracket spaces / arrows always

Input

Output

Formatted output will appear here.

JavaScript Formatter

Paste or import JavaScript above and click Prettify to reformat it with consistent indentation and spacing — free, in your browser, with nothing uploaded to a server. Powered by Prettier.

Configurable Prettier

JavaScript formatting supports print width, indentation, semicolons, quotes, trailing commas, bracket spacing, and arrow parens.

Parser limits

This is formatting, not linting or execution. Syntax must parse as JavaScript before Prettier can rewrite it.

Other formatters

Need to convert Markdown instead? Try the free Markdown to Word/HTML/PDF converter.

Need to run some numbers? Try the free online calculators.

Frequently asked questions

How do I beautify JavaScript online?+

Paste your code, adjust Prettier options if needed, then click Prettify to reformat spacing, quotes, semicolons, trailing commas, and arrow parens.

Does it work on minified code?+

Yes — pasting a minified one-liner and prettifying it will expand it back into readable, indented code.

Is my code sent to a server?+

No. The formatter runs entirely in your browser.

More formatters

JSON formatter · TypeScript formatter · CSS formatter · YAML formatter · C formatter · C++ formatter · VBScript formatter

We use cookies to show ads via Google AdSense. See our Privacy Policy for details.