WebBeautify

Beautify messy code so you can actually read it

A beautifier pretty-prints minified or machine-emitted code: indent, line breaks, the outline of the file. People also search unminify, pretty print, and “make this readable.” Names and logic stay. Only whitespace comes back — it is not a decompiler.

Minified JS (unreadable)Beautified / pretty-printfunction hi(n){return"Hi, "+n}function hi(n) {return "Hi, " + n;}Names stay. Only whitespace comes back. That is unminify, not decompile.
Beautify tools

Why people beautify (and when they say pretty-print)

A vendor sends one 4,000-character JavaScript line. A CMS coughs HTML with no indent. Chrome’s “pretty-print” in DevTools is the same instinct: you need to see the braces. An HTML beautifier, CSS beautifier, or JS beautifier is for the paste you will save or debug — not for rewriting architecture.

Pretty-print, beautify, and format overlap. Beautify is the word people type when the file looks crushed. Pretty-print is the word API folks use for JSON. Format is the word teams use when they want consistent indent every time (two spaces, keywords cased, YAML lined up). Prettier in a repo is still the source of truth for a project; an online beautifier is for the blob that never saw your repo.

Minified JS (unreadable)Beautified / pretty-printfunction hi(n){return"Hi, "+n}function hi(n) {return "Hi, " + n;}Names stay. Only whitespace comes back. That is unminify, not decompile.
Beautify / pretty-print restores indent so you can read minified code.

How to unminify JavaScript, HTML, or CSS

Paste the minified file. Run the matching beautifier — JavaScript beautifier for `.js`, HTML beautifier for markup, CSS beautifier for stylesheets. Indent appears. Identifiers that Terser already mangled to `a` and `b` stay `a` and `b`; source maps are how you get real names in DevTools. Beautify a function you care about if the whole vendor bundle is a wall.

Watch ASI in JavaScript: `return` then a newline then `{}` is not `return {}`. Watch HTML: a newline between `<span>A</span>` and `<span>B</span>` can become a space. Those are language rules. If output looks cursed, run it before you trust it.

Tools in this hub

Questions about beautify

What does a beautifier change, and what should it leave alone?

Indent and line breaks. Not variable names, not logic. function x(){return 1} becomes a small outline you can read. If meaning changes, the pass was too clever — stop and use a parser you trust.

Is beautify the same as format or pretty-print?

For a crushed file, yes enough: indent comes back. Beautify / unminify is what people type when JavaScript or HTML is one line. Pretty-print is the JSON / API word. Format is the “same indent every time” word (JSON formatter, SQL formatter). Prettier in git is still the project tool. An online beautifier is for the paste that never saw your repo. Minify again when the file goes live.

Will beautify change program meaning?

It should not. Watch JavaScript ASI: return\n{} is not return {}. Watch HTML: a newline between <span>A</span> and <span>B</span> can become a space. Those are language rules, not “the beautifier got creative.”

Can I beautify a whole minified library?

You can try. Huge vendor bundles are slow and rarely worth editing. Beautify the function you care about. Example: pull one function hi(name){...} out, indent it, leave the rest of vendor.js alone.

Fun fact about HTML beautify?

Fun fact: DevTools shows the live DOM after the parser already “fixed” your tags. Beautify the source you will save, not the tree the browser invented. <p>Hi <div>there is a different story in each view.

Does XML beautify prove the file is valid?

No. Pretty XML can still be ill-formed. Indent follows nesting when the document parses. If <item> never closes, validate first — pretty-print on broken XML is a guess.

Should I beautify SQL?

The database does not care. Humans catch a missing WHERE when FROM users sits on its own line. SELECT * FROM users JOIN orders is how you scan a table by accident. Format is a review tool, not an index.

When is beautify a bad idea?

Generated files you do not own, or a pull request where whitespace is the whole diff. Beautify once, commit, stop fighting the file. Then minify the copy that actually goes live.