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.
Paste JavaScript above and the result appears here.
- Runs in your browser
- No account required
- Free to use
How it works
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.
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.
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.
Related tools
JSON Formatter
Format and minify JSON, with errors that name the line.
Runs entirely in your browser
Open toolJSON Validator
Check JSON and get the line, column and cause of any error.
Runs entirely in your browser
Open toolJSON Viewer
Explore JSON as a collapsible tree instead of scrolling it.
Runs entirely in your browser
Open toolJSON to CSV
Turn an array of objects into a spreadsheet-ready CSV.
Runs entirely in your browser
Open toolWho 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.
Web Design
Custom, conversion-focused web design that captivates visitors and turns them into paying customers. Mobile-first, fast, and built to rank.
Web Development
Custom WordPress websites built with clean code, blazing-fast performance (Core Web Vitals optimised), and enterprise-grade security.
E-Commerce
Online stores that convert visitors to customers with seamless shopping experiences.
SEO
Technical SEO, keyword research, on-page optimisation and local SEO strategies that drive qualified organic traffic.
Digital Marketing
Data-driven campaigns that deliver measurable ROI across every channel.
Branding
Memorable brand identities that stand out in any market and build lasting trust.
Website Help
One-on-one expert support for bug fixes, updates and ongoing maintenance — without a long-term retainer.
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.