JavaScript Formatter

Paste code above to see the formatted result.

About this tool

Beautify JavaScript, JSX, TypeScript and TSX with Prettier. Adjust indentation, line width, semicolons and quote style, then copy the readable result. All processing happens locally in your browser.

How to use
  1. Paste your JavaScript or TypeScript code into the input box.
  2. Pick the JS or TS parser, then tune indentation, line width, semicolons and quotes.
  3. Copy the formatted result; syntax errors are shown inline without clearing your input.
Is my code uploaded anywhere?

No. Formatting runs entirely in your browser with Prettier, so your code never leaves your device.

Does it minify my code?

No. This tool only beautifies code into a readable layout; it does not compress or minify.

Which languages are supported?

JavaScript, JSX, TypeScript and TSX. Switch the parser between JS and TS as needed.