JavaScript Formatter
Turn compact or inconsistent JavaScript and JSX into readable code. Choose indentation, quotes, semicolons, trailing commas and line width.
.prettierrc, project files or remote plugins. TypeScript/TSX is not supported here.Readable output with a few practical choices
Set common style preferences, then format once. Invalid JavaScript is reported instead of producing output.
LayoutChoose 2 or 4 spaces, tabs, and a print width of 80, 100 or 120 columns.StyleSet single or double quotes, semicolons, object spacing, trailing commas and arrow-function parentheses.JavaScript & JSXFormat standard JavaScript and JSX using the bundled Babel parser and Prettier’s JavaScript printer.Parse feedbackWhen the parser rejects source, the message includes the available line and column rather than running the code.Your code stays in the browser
Formatting runs in a dedicated Web Worker with a self-hosted Prettier 3.9.10 bundle. Your code is parsed and printed as text; it is never evaluated, rendered, uploaded or saved by this tool. No project files, configuration files or remote plugins are loaded.
Input is limited to 1 MiB. The page is configured for JavaScript and JSX; it does not support TypeScript or TSX. Prettier applies its standardized layout, so output may differ from a project's custom formatter configuration.
Prettier is distributed under the MIT License. The self-hosted vendor directory includes the license and third-party notices.
Frequently Asked Questions
No. The source is parsed and printed in a local worker. It is never evaluated or rendered.
No. This standalone browser version uses only the options shown on this page. It does not read project configuration or load plugins from the network.
No. This formatter page is configured for JavaScript and JSX, not TypeScript or TSX.
The parser reports the error, with a line and column when available. The formatter does not output code for invalid source.
No. Formatting runs locally and the tool does not save or upload your source.