HTML Beautifier
Re-indent and space out HTML markup to make it readable again.
Make minified or messy JavaScript readable again with proper indentation, line breaks and spacing. Ideal for debugging, code review and learning from other code.
Paste or type to begin. Everything runs in your browser.
How it works
Paste JavaScript (minified bundles work), drop a .js file onto the input, or load the sample.
Choose an indent and brace style. Packed and escaped code is unpacked where possible.
Copy the readable code or download it as a .js file.
About this tool
A JS beautifier reformats JavaScript with consistent indentation, spacing and line breaks so the structure of functions, loops and objects is clear. It's often used as a JavaScript unminifier: production bundles are compressed onto a single line, and beautifying them is the first step to understanding or debugging them.
Readable code is easier to review, share and maintain, especially on large projects where several developers work on the same files. This tool is based on the widely used js-beautify library, and it can also unescape \xNN-encoded strings that are sometimes used to hide code.
Expand single-line, minified JavaScript into readable code.
Keep braces on the same line or put them on a new line.
2 spaces, 4 spaces or tabs.
Code is formatted in your browser, so proprietary code stays private.
FAQ
No. Minifiers often rename variables to short names like a or e. Beautifying restores the layout, but the original names can only come from a source map.
Plain TypeScript and JSX usually format well. Very new syntax may not be recognised perfectly, since the tool targets JavaScript.
No. Only whitespace and line breaks change, so the code behaves the same.
No. This tool runs entirely in your browser using JavaScript. Your files and text never leave your device, so it's safe for private or confidential work.
Missing something?
Instant.tools grows from real requests. Describe the task you're stuck on and we'll consider building it next.