JavaScript Formatter
NOVOFormat and beautify JavaScript and JSON with Prettier: choose indent, quotes and semicolons, then copy the result.
Funciona 100% no seu navegador — o que você insere nunca é enviado nem armazenado nos nossos servidores.
Esta ferramenta ainda não está totalmente traduzida, por isso parte do texto continua em inglês. A ferramenta funciona da mesma forma em todos os idiomas.
Paste code above and press Format (or just wait — it formats as you type).
Exemplos rápidos
Entradas típicas e os resultados que esta ferramenta gera.
Visão geral
This JavaScript formatter beautifies minified, copy-pasted or inconsistent code using Prettier, the same engine many teams run in their editors and CI. Paste JavaScript, JSX, TypeScript, TSX, JSON, JSON with comments or JSON5 and get consistent indentation, line breaks and quotes in one click.
Developers use it to read code copied from DevTools or a bundle, clean up a snippet before a code review, or settle a style debate: pick 2, 4 or 8 spaces or tabs, a print width from 40 to 200, semicolons on or off, single or double quotes, trailing commas, arrow parentheses and more. Files can be uploaded or dropped in, and the download keeps the original extension.
Formatting runs entirely in your browser with Prettier loaded on demand, so your source code is never uploaded. If the code has a syntax error, the exact line and column are shown and that line is selected in the input.
Por que usar esta ferramenta?
- Prettier output, no editor setup needed
- JavaScript, JSX, TypeScript, TSX and JSON
- Exact line and column for syntax errors
- Upload or drop a file, download the result
- Private: your code never leaves the browser
Recursos
Prettier engine
Uses Prettier 3 parsers (Babel, TypeScript, JSON, JSON5) so the output matches what most projects already use.
Language auto-detect
Picks JavaScript, JSX, TypeScript, TSX or JSON from the file extension or the code itself, or choose a parser manually.
Prettier options
Indent, print width, semicolons, quotes, trailing commas, arrow parens, quote props, bracket spacing, line endings and object wrapping.
Precise error location
Syntax errors show line, column and a code frame, and the offending line is selected in the input.
Upload and download
Drop a .js, .jsx, .ts, .tsx or .json file and download the formatted version with the same extension.
Size and line counts
See lines and size before and after, and send the output back to the input to format again with new options.
Como usar
Add your code
Paste code into Code input, upload a file, drop one onto the box, or press Sample.
Choose the language
Leave Language / parser on Auto-detect or pick JavaScript, JSX, TypeScript, TSX, JSON or JSON5.
Set the style options
Pick indentation, print width, quotes, semicolons, trailing commas and the other options.
Copy or download
Press Format (or let it format as you type), then Copy, Download or Use as input.