Spread a minified or tangled script back out into readable code with the js-beautify engine. Choose a 2 space, 4 space or tab indent and read it like source again.
Your files are processed in your browser, on your own device. Nothing is uploaded to a server.
A JS Beautifier spreads compressed or tangled JavaScript back out into lines a person can read. This one runs js-beautify in your browser at no cost and with no upload. Functions, loops and callbacks land at their proper depth, with a 2 space, 4 space or tab indent to pick from.
js-beautify reads your script as a stream of tokens and rebuilds the line breaks and indentation from the structure it finds. Nested callbacks step inward level by level, chained calls settle onto readable lines, and the code keeps the exact same tokens in the exact same order.
Formatting changes whitespace and line breaks only. It never reorders statements, renames anything or rewrites expressions, so the code you get back runs the way the code you pasted in ran.
Reading someone else’s bundle is the classic case. A minified library file, a vendor script, or the one file a past developer left behind holds an answer you need: what a function does, where a setting lives, why a call fires twice. Spread out with real indentation, the file becomes a document instead of a riddle.
Rescued code is the second case. JavaScript copied out of a browser console, lifted from a live page, or pasted from a ticket often arrives flattened or wrapped in odd places. Format it before it goes anywhere near your own project, so the file you keep is readable from day one. The CSS Beautifier and the HTML Formatter do the same rescue work for the other two languages in a page.
Debugging is the quiet third case. Indentation is a debugging tool, not a cosmetic one, because a callback nested five levels deep, or a brace that closes one level too early, is visible at a glance once the lines spread out. When the code is understood and fixed, the JS Minifier packs it back down for shipping.
js-beautify works from tokens, not from a full parse of your program. That design is fast and forgiving, and it carries one hard limit: it cannot recover what minification destroyed. Variable names that were shortened stay shortened, and comments that were deleted stay deleted. Only a source map, used in browser developer tools, can reconnect the shipped code to the original names.
Invalid code gets no clean error either. A parser would stop and complain, while a token-based formatter indents around its best guess. Broken JavaScript can come out looking oddly laid out instead of flagged. If the output reads strangely in one spot, that spot is a good place to run a syntax check on the input.
TypeScript and JSX deserve a mention too. Type annotations and JSX markup can format imperfectly with a token-based tool that expects plain JavaScript. Plain JavaScript is the safe input here, and it is what this page is built for.
js-beautify runs inside your browser tab. Your code is never sent to a ToolPeko server, never stored and never read by anyone here. That holds for an internal script you would not paste into a stranger’s service just as much as for a public library file. There is no account, no sign-up and no formatting counter. Paste a snippet or a full bundle and the terms stay the same.
No. Minification replaced the names, and formatting only restores whitespace and line breaks. A source map in browser developer tools is the one route that reconnects shipped code to original names.
No. Formatting changes whitespace and line breaks only. Tokens, names and statement order stay exactly as they were, so the formatted file runs the way the pasted file ran.
The tool reads tokens and indents around its best guess instead of stopping with an error. Oddly laid out output is often the first visible sign that the input has a syntax problem worth checking.
Two spaces is the common pick in web projects, with tabs a strong second. Match wherever the code will live, since consistency with the surrounding files matters more than the choice.
You can, but type annotations and JSX markup can format imperfectly with a token-based tool. Plain JavaScript is what this page is built for, and it gives the cleanest results.
No upload happens. The formatting runs in your browser tab, and nothing is sent to or stored on a ToolPeko server.
Same rules as this one: free, in your browser, with nothing uploaded.
Paste messy JSON, get it neat and valid.
Check JSON and find the exact line that breaks it.
Squeeze JSON down to one tight line.
Open JSON as a tree you can fold and explore.
JSON rows turned into a CSV a spreadsheet can open.
A CSV file turned into clean JSON objects.
JSON rewritten as YAML for config files.
YAML config turned into JSON you can use in code.