Task path / input to outcome
How to format JavaScript
- 01
Paste your JavaScript
Paste source up to 256 KiB UTF-8. Select two or four spaces for formatting.
- 02
Choose the indentation
Choose 2 or 4 spaces. The sample is preloaded; the new setting takes effect when you press Format.
- 03
Format without executing
Press Format. Prettier parses and reprints JavaScript with the chosen indentation and a 100-column print width without executing it; run your tests.
- 04
Review the result and statistics
Compare UTF-8 input and output bytes and the savings percentage. A negative saving means the result grew; inspect it before copying or downloading.
- 05
Copy or download the result
Copy result sends the formatted code to the clipboard; Download saves it as toolars.js. Reset clears the input, output, and options when you are ready for the next snippet.