JavaScript Beautifier
Format JavaScript, TypeScript and JSX with your choice of indent, quotes, semicolons and line width. Private, runs in your browser.
JavaScript, TypeScript or JSX
Stays in your browserResult
Shortcuts: Ctrl+Enter run · Ctrl+Shift+C copy result · / search (use ⌘ on Mac)
Next steps
Done here? Use the Send to… menu on the result to carry it on to JavaScript Minifier or HTML Beautifier.
Free Online JavaScript Beautifier
Turn minified or messy JavaScript into readable code. Choose JavaScript, TypeScript or JSX and your preferred style. It gives developers a quick browser-based way to solve a focused javascript beautifier task before moving the result into a project.
How to use the javascript beautifier
Paste your code in the box, adjust the options if you want, and press Format. The code is formatted with Prettier. Pick the language, indent, quote style, semicolons, trailing commas and line width, then press Format.
Common mistakes
- Pick TypeScript for code with type annotations, otherwise the JavaScript parser stops at the first type.
- Syntax errors are reported with a line and column; fix the first one and format again.