Beautify and prettify JavaScript with consistent indentation and spacing. Runs entirely in your browser.
How to use the JS Formatter
Paste your JavaScript into the input box.
Pick the indent size you want.
Copy the beautified result.
Frequently asked questions
No, it only beautifies. Safe JavaScript minification needs a full parser to rename and drop code without changing behaviour, so this tool focuses on making code readable rather than smaller.
Yes. JSON is valid JavaScript syntax, so pasting a JSON object or array formats it cleanly with proper indentation.
No. Formatting runs entirely in your browser, so your code never leaves your device, which is important for proprietary or sensitive scripts.
A JavaScript beautifier that reformats minified or messy code with consistent indentation, spacing and line breaks for easier reading and debugging.
It is powered by a well-established formatting engine and runs locally in your browser, so your code stays private.
Related tools
Generate SHA-1, SHA-256, SHA-384 and SHA-512 hashes of any text, right in your browser.
Convert colors between HEX, RGB and HSL with a live preview.
Convert Unix timestamps to human dates and back — UTC, local, ISO 8601 and relative time. Seconds and milliseconds are auto-detected.
Percent-encode and decode URLs and URL components, UTF-8 safe.
We use essential cookies to run the site. With your consent we also load Google AdSense, which sets advertising cookies. See our privacy policy.