Code & Data

Format JavaScript without it touching your strings

Paste minified or badly indented JavaScript and get it back readable. It reads the code as tokens rather than running patterns over the text, which is why the contents of your strings come out exactly as they went in.

or paste your own — nothing is uploaded.
Formatted JavaScript

Paste JavaScript above and the result appears here.

  • Runs in your browser
  • No account required
  • Free to use

How it works

01

A tokenizer, not a search and replace

Most quick formatters collapse whitespace with a regular expression across the whole file. That reaches inside quotes: `"a b"` comes back as `"a b"`, and nobody notices until something downstream compares strings. Here the source is split into strings, comments, regexes and code first, and only the code is touched.

02

It knows a regex from a division

A slash is either division or the start of a regular expression, and only what came before it decides which — `a / b` against `return /ab+/`. Getting that wrong is not a cosmetic bug: the tokenizer starts reading a regex where there is none and swallows the rest of the file looking for the end of it.

03

Braces are classified before anything moves

A brace opening a block and a brace opening an object literal look identical and behave differently, and so do the parentheses of a call and those of an `if`. Both are worked out from what precedes them, which is what lets `if (a)` keep its space while `f(x)` does not get one.

What it does

Two, four or tabs

Whatever your project already uses. The setting changes the output as you watch.

Comments kept, or not

On by default, because a comment is usually the most valuable line in a file you are trying to read.

Blank lines survive

A run of empty lines becomes one, rather than all of them being deleted. The paragraphs somebody put in are part of how the code reads.

Runs in your browser

No account and no upload — what you type is never sent anywhere. Analytics records that the tool was opened, never what you put into it.

Practical advice

Getting a better result

  • If the result looks wrong, check the bracket count first — the panel says how many are left open, and one missing brace makes everything after it indent strangely.
  • This will not reflow a 200-character line. Deciding where to break an expression well needs to understand what it means, and a formatter that guesses makes code harder to read, not easier.
  • JSX passes through rather than being formatted. Angle brackets are ambiguous with comparison operators without a full parser, and mangling somebody’s components would be worse than leaving them alone.
  • Formatting is stable: running it on already-formatted code gives you the same file back, so it is safe to use in a paste-check-paste loop.
  • For a real project, a formatter in your editor with a config file beats a web page. This is for the times you have been handed a file and just need to read it.

Questions

Things people ask

Will this change what my code does?

No. It only adds and removes whitespace between tokens and never reorders or rewrites anything. Strings, template literals, regexes and comments are copied through untouched.

Does it work on minified code?

Yes — that is the main thing it is for. It will not restore variable names, because those are gone from the file entirely, but the structure comes back.

Does it check my JavaScript for errors?

Only the things a tokenizer can see: unbalanced brackets, an unterminated string, a comment that is never closed. It cannot tell you about a misspelled name or a missing argument, and it says so rather than implying the code is fine.

Can it handle TypeScript?

Mostly, since the tokens are nearly the same, but type annotations are not understood as syntax and generics use the same angle brackets that JSX does. Expect it to work on plain code and to leave heavily typed code alone.

Who builds these

Free tools by day. Websites that earn their keep by trade.

KuConvert is built by KUDUY, a web design and development agency. From custom WordPress builds to SEO and e-commerce, everything they do is engineered to bring you more qualified traffic and turn it into revenue.

  • Fixed scope, no surprise invoices

    Most sites ship in four to eight weeks with the scope and the price agreed up front.

  • SEO from day one

    Search is designed into the build — structure, schema and Core Web Vitals — not retrofitted.

  • A team, not a ticket queue

    A project manager, a designer and a developer you can actually reach.

Need your whole site to load this fast?

Images are usually the heaviest thing on a page and the easiest win. KUDUY works on site speed, image delivery and Core Web Vitals for teams who would rather not do it by hand.

This tool runs entirely in your browser. Your files are never uploaded.