Code Unminifier (Beautify)

Paste minified JavaScript, CSS, HTML, JSON, XML, SQL or SVG and get clean, indented, readable code instantly. Live before/after diff, custom indentation, 7 languages. Free, private and no sign-up.

Code Unminifier by Utiliby

Free Code Unminifier & Beautifier

Paste minified code, get readable output. Live diff view, 7 languages, custom indentation.

Input — paste minified code

📁 Drop a file here or click to browse — .js, .css, .html, .json, .xml, .svg, .sql

Formatting options

Share, cite or embed this tool

What is a free code unminifier online?

A free code unminifier online is a tool that takes minified, compressed or obfuscated code and reformats it with proper indentation, line breaks and spacing so it becomes readable again. When a production build pipeline runs UglifyJS, Terser, CSSNano or html-minifier, the output collapses onto a single line with short variable names and no comments. That output is optimised for browsers, not for humans. An unminifier reverses the formatting — not the semantics — so you can read, debug, review or learn from the code.

This code beautifier and unminifier goes beyond the basics. It supports JavaScript, TypeScript, CSS, SCSS, LESS, HTML, JSON, XML, SVG and SQL, with a live before/after diff view, custom indentation, brace style and line-wrap options. It also includes a minifier for the reverse operation, a file-drop zone for pasting in .js, .css or .html files, and a built-in guide covering every language-specific option. Everything runs in your browser — no sign-up, no account, no upload, no tracking.

How to use this free code beautifier online

  1. Select the language. Click the language button at the top (JavaScript, CSS, HTML, JSON, XML, SQL, SVG). Auto-detect is available if you are not sure.
  2. Paste or drop your code. Paste directly into the textarea, or drag a file from your desktop onto the drop zone. Accepted extensions: .js, .ts, .css, .scss, .less, .html, .json, .xml, .svg, .sql.
  3. Configure formatting options. Choose 2 spaces, 4 spaces or tabs. Set the brace style (collapse, expand, end-expand). Choose whether to preserve comments and blank lines. Set a maximum line length if you want wrapping.
  4. Click Beautify. The formatted output appears below, with a live diff showing exactly what changed line by line.
  5. Copy or download. Use the copy button or download the formatted file. Switch to the Minify tab to reverse the operation.

What minification actually does

Minification is a build-time optimisation that reduces file size by removing every character a browser does not need to execute the code. The main transformations are:

TransformationExampleReversible?
Remove whitespace and line breaksvar a = 1; → var a=1;✅ Yes — unminifier restores it
Remove comments// note → removed❌ No — comments are discarded
Shorten variable namesuserCount → n❌ No — needs source map
Shorten function namescalculateTotal → c❌ No — needs source map
Remove dead codeUnused functions removed❌ No — code is gone
Collapse booleans / numberstrue → !0✅ Partially — beautifier can expand
Reorganise CSS rulesDeclarations reordered✅ Yes — beautifier expands them

The critical distinction: formatting is reversible, semantics are not. An unminifier can restore indentation, line breaks and spacing, but it cannot recover variable names, comments, or deleted dead code. For full source recovery you need the original source map (.map file) produced by the minifier.

Language-specific formatting rules

JavaScript and TypeScript

JavaScript beautification inserts newlines after semicolons and braces, indents block statements, spaces around binary operators, and preserves string quoting. The js-beautify library — the same engine used inside VS Code, Atom and Sublime Text — powers the core formatting. Options include brace style (collapse, expand, end-expand), space-before-conditional, and jslint-happy mode for stricter spacing.

TypeScript is formatted with the same rules plus support for type annotations, generics, decorators and interfaces.

CSS, SCSS and LESS

CSS beautification expands each declaration onto its own line, indents nested rules, normalises spacing after colons and before braces, and converts rgb() and hex colours into a consistent form. SCSS and LESS get the same treatment with additional support for variables ($var, @var), mixins, nested selectors and control directives (@if, @each).

HTML and XML

HTML beautification indents nested tags, puts each attribute on a new line when the line would exceed the wrap length, preserves inline elements like <span> and <a>, and handles HTML5 void elements correctly. XML uses the same engine with self-closing tags, CDATA sections and processing instructions supported. SVG is treated as a special case of XML with additional handling for <path> data and <g> grouping.

JSON

JSON beautification uses JSON.parse followed by JSON.stringify with the chosen indent, which guarantees the output is valid JSON. The tool also validates the input and reports the exact position of any syntax error. For JSON with comments (JSONC, used in VS Code settings), a lightweight pre-processor strips the comments before parsing.

SQL

SQL formatting uppercases reserved keywords (SELECT, FROM, WHERE, JOIN), puts each clause on its own line, indents subqueries and CASE expressions, and aligns AND/OR conditions. Supported dialects: standard SQL, MySQL, PostgreSQL and SQLite. This is a rule-based formatter, not a full SQL parser, so it handles the common patterns used in application queries.

When to use an unminifier

Source maps: the full source recovery path

A source map is a JSON file (usually .js.map) that the minifier produces alongside the minified code. It contains a mapping from each position in the minified output back to the original source file, line and column. When a source map is available, you can recover not just the formatting but the actual original variable names, comments and file structure.

To use a source map:

  1. Locate the .map file, either alongside the minified file on the server or in your build output directory.
  2. Use a tool like source-map (Mozilla), sourcemapper or webcrack to apply the map and reconstruct the original source.
  3. For stack-trace symbolication specifically, error monitoring services like Sentry, Bugsnag, Rollbar and Datadog accept uploaded source maps and automatically de-minify production stack traces.

Source maps are usually disabled in production (or restricted to the error monitoring service) because they expose the original source code to anyone who can download them. If you find a .map file publicly accessible on a site, the site's original source is effectively exposed.

Common unminifier limitations

Frequently asked questions

What is a free code unminifier online?

A free code unminifier online takes minified code and reformats it with proper indentation, line breaks and spacing. It supports JavaScript, CSS, HTML, JSON, XML, SQL and SVG, and runs entirely in your browser.

How do I unminify JavaScript online?

Paste the minified JavaScript, select JavaScript as the language, choose indentation, and click Beautify. The tool uses the js-beautify library and never uploads your code.

Does unminifying restore variable names?

No. Minifiers rename local variables to short identifiers and this mapping is not recoverable without a source map. Unminifying restores structure and readability, not original names.

What is the difference between minify and beautify?

Minifying removes whitespace, comments and line breaks to reduce file size. Beautifying adds them back to make code readable. This tool does both.

Is unminified code the same as the original source?

No. Unminifying restores formatting but not variable names, comments, or original file structure. The beautified output is functionally identical but not character-identical.

Which languages does this code beautifier support?

JavaScript, TypeScript, CSS, SCSS, LESS, HTML, JSON, XML, SVG and SQL.

Can I beautify CSS from Bootstrap or Tailwind?

Yes. Paste the minified CSS and the tool reformats it one declaration per line with proper indentation.

Does this tool upload my code to a server?

No. All processing happens in your browser. Your code never leaves your device.

What indentation options are available?

2 spaces, 4 spaces, or tabs. You can also configure brace style, comment preservation, blank line preservation and maximum line length.

Is this code unminifier free?

Yes. Free, browser-based, no sign-up, no tracking, no ads.

Disclaimer: This tool is provided for development, debugging and educational purposes only. Unminifying third-party code may be subject to licence restrictions, terms of service, or copyright law. Always respect the licence of any code you inspect. The output is functionally equivalent to the input but not character-identical to the original source — variable names, comments and removed code cannot be recovered. For production debugging, use the original source map where available. Utiliby accepts no liability for how the output is used or for any inaccuracies introduced by the formatting process.