Skip to content
DDevToolery

JavaScript Formatter

Format JavaScript with Prettier, entirely in the browser.

Loading tool…

About this tool

Formats JavaScript by parsing it into a syntax tree and printing that tree back out. The code is never evaluated, so pasting something you do not trust is safe here — though a syntax error will stop it, since a tree cannot be built.

Limitations

  • The code is parsed, not executed. DevToolery never evaluates anything you paste.
  • A syntax error means Prettier cannot build an AST, and the parser's message is shown instead.

Questions

Is my code executed?
No. It is parsed the way a linter parses it. Nothing runs, and nothing is sent anywhere.
It reformatted my carefully aligned code.
That is what a formatter does — it discards your line breaks and re-derives them from the syntax tree. Consistency is the point; the trade is that manual alignment is lost.

Privacy

This page does its work in your browser. What you paste is processed by JavaScript running on your own device and is never sent to a DevToolery server — there is no server that could receive it. The page itself is a static file delivered by a CDN. See exactly what is stored.