EN
My tools

JavaScript Beautifier / Formatter

Format minified or messy JavaScript with consistent indentation, one statement per line and spaces around operators. Strings, regexes and templates untouched.

Formatted JavaScript

17 lines · 86 tokens · strings, regular expressions and template literals are copied exactly.

My tools →
Advertisement

Minified bundles and code pasted from chat or e-mail are hard to read. This beautifier re-indents JavaScript by its braces, brackets and parentheses, puts one statement on each line and adds spaces around operators, so you can follow the logic, review it or debug it. It works on tokens rather than a full parser: strings, regular expressions and template literals are copied character for character, and comments are kept.

How to use this tool

  1. Paste the JavaScript into the box; the formatted version appears as you type.
  2. Choose 2 spaces, 4 spaces or tabs for indentation.
  3. Pick a brace style: on the same line as if/for/function, or on a line of its own.
  4. Decide how many blank lines in a row to keep, then copy the result.

Formula

indent = number of open { [ ( that started a multi-line block × your indent unit

A { opens a block or an object literal and starts a new indented line; } closes it. ; ends a line, except inside a for (…) header. Commas break lines inside object literals and inside brackets you had already split over several lines. Where your code relies on automatic semicolon insertion — a line break after return, or a statement starting with ( or [ — the line break is kept, so the formatted code behaves exactly like the original.

Example

The minified line if(a){b()}else{c()} becomes five lines: if (a) {, then b() indented by two spaces, then } else {, c() indented again, and a closing }. With the own-line brace style the opening braces move to lines of their own and else starts a new line.

Frequently asked questions

Does it change what my code does?

No. Only whitespace between tokens is changed. Line breaks that matter for automatic semicolon insertion are preserved, and the contents of strings, regexes and templates are never touched.

Does it support TypeScript or JSX?

It is built for plain JavaScript (ES2023). TypeScript type annotations and generics, and JSX markup, are not understood and may be spaced oddly — use a TypeScript-aware formatter for those files.

Can it un-minify variable names?

No. Minifiers that rename variables throw the original names away; formatting can restore the layout but not the names.

Is my code uploaded?

No. Formatting runs in your browser, so private source code stays on your device.

Sources

Last updated:

Cite or embed this tool
APA

kakaoCalc. (2026, November 8). JavaScript Beautifier / Formatter. https://kakao.mobile/tools/javascript-beautifier/

MLA

“JavaScript Beautifier / Formatter.” kakaoCalc, 8 Nov. 2026, kakao.mobile/tools/javascript-beautifier/.

Paste this code into your page. The widget runs in your visitors' browsers, shows no ads and keeps a link back to this page. Embedding terms

Advertisement