JavaScript Beautifier
Format and beautify JavaScript (including JSX and modern syntax) with Prettier: indentation, quotes and semicolons.
Runs in your browserJavaScript → JavaScript
Loading tool…
Example
const add=(a,b)=>{return a+b}
console.log(add(1,2),'done')const add = (a, b) => {
return a + b;
};
console.log(add(1, 2), "done");How to use the JavaScript Beautifier
- Paste or type your JavaScript into the input area, or open a file from your device.
- Adjust the options above the editor if the tool offers any.
- Review the JavaScript result, then copy it or download it as a file.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
Frequently asked questions
Can it un-minify code?
It restores indentation and line breaks, but minified variable names cannot be recovered because the original names are no longer in the code.
Is my code uploaded?
No. Prettier runs entirely in your browser.
Related converters
TypeScript FormatterFormat TypeScript and TSX with Prettier, including interfaces, generics, enums and decorators.JavaScript Syntax ValidatorCheck JavaScript for syntax errors using the latest ECMAScript grammar, with line, column and a code frame.JavaScript MinifierMinify JavaScript with Terser: remove whitespace and comments, shorten variable names and drop dead code.CSS BeautifierBeautify minified or messy CSS into readable, consistently indented rules with one declaration per line.SCSS FormatterFormat SCSS/Sass stylesheets with Prettier, handling nesting, variables, mixins and maps.Less FormatterFormat Less stylesheets with Prettier, keeping variables, mixins and nested rules readable.HTML BeautifierBeautify HTML with Prettier: consistent indentation plus formatting of embedded CSS and JavaScript.Markdown FormatterNormalise Markdown with Prettier: consistent list markers, headings, emphasis and table alignment.