Input
Formatted
Output will appear here
Input
Formatted
Output will appear here
JavaScript Formatter
Format or minify JavaScript code using Prettier WASM. Supports ESNext, JSX, async/await, optional chaining, and all modern JS syntax. Toggle between format and minify modes.
Use Cases
- Formatting pasted code snippets before adding to documentation
- Quick minification for testing purposes
Frequently Asked Questions
Does it support JSX?
Yes. The Babel parser used supports JSX syntax natively.
Does minify actually compress the code?
Prettier's minify mode removes whitespace and newlines but does not rename variables like Terser would. It's useful for quick copy-paste compression, not production builds.