JavaScript Formatter & Beautifier
Re-indent JavaScript and TypeScript source. Free, and runs entirely in your browser — nothing you enter is uploaded, stored or sent to a server.
About JavaScript Formatter
Re-indents JavaScript and TypeScript by block depth so a minified bundle, a snippet pasted from a stack overflow answer, or a compressed inline script becomes readable enough to follow.
It is a formatter for reading, not a build step. When you want opinionated project-wide formatting — quote style, semicolons, line width — Prettier in the repository is the right tool; this is for the code you have in front of you right now.
Where it helps
- Makes minified or single-line source followable in seconds.
- Understands JavaScript and TypeScript alike.
- The editor highlights syntax while you work.
- Nothing is uploaded, so proprietary source stays local.
Limits
- Indentation only — it does not rewrite quotes, semicolons or line width the way Prettier does.
- Minified code stays minified in the ways that matter: mangled names are not recoverable.
- It does not parse and re-print, so unusual syntax may indent imperfectly.
- No linting: unused variables and likely bugs are not reported.
Frequently asked questions
Can it recover the original variable names in a bundle?
No. Minifiers discard names permanently. A source map is the only way back, and you need the map file.
Should I use this instead of Prettier?
No. Use Prettier for your codebase; use this for a snippet you have pasted and want to read.
Does it support JSX and TypeScript generics?
They are handled as source text, so the result is readable, though a dedicated parser will lay some constructs out better.
Can it check my syntax?
The editor flags obvious problems, but this is a formatter and not a linter or a type checker.
Related tools
- Minifier — Shrink CSS, HTML or JavaScript
- CSS Formatter — Format stylesheets with consistent indentation
- HTML Formatter — Indent and tidy HTML markup
- Structure Formatter — Pretty-print JSON, XML, YAML, TOML, TOON or HCL with a chosen indent
- SCSS/SASS Formatter — Format SCSS syntax and nested rules
- TypeScript Formatter — Format TypeScript source code
More Web Development tools
- HTML Formatter — Indent and tidy HTML markup
- CSS Formatter — Format stylesheets with consistent indentation
- SCSS/SASS Formatter — Format SCSS syntax and nested rules
- TypeScript Formatter — Format TypeScript source code
- SQL Formatter — Format SQL statements with dialect selection
- SQL Minifier — Collapse formatted SQL into compact text
- CSS Unit Converter — px, rem, em, percentages and viewport units, with a preview
- Query String Parser and Builder — Convert query strings into editable key-value data
- CSP Generator — Build a Content-Security-Policy, or check one, and write it for your server or framework
- CORS Generator — Write CORS configuration for nginx, Express, Go, Django, ASP.NET, Spring and more, and test an origin against it
- cURL Builder — Build an HTTP request and get it as curl, JavaScript, TypeScript, Go, Python, PHP, C#, Java and more
- Minifier — Shrink CSS, HTML or JavaScript
- Flexbox Playground — Try every flex property and read the CSS back
- CSS Grid Playground — Build a grid template and see the tracks it makes
- Responsive Viewport Tester — Render your markup at phone, tablet and desktop widths
- SVG Path Viewer — Draw path data and read back what it contains
- SVG to CSS Converter — Turn an SVG into a data URI for CSS or an img tag
- OAuth 2.0 / OIDC Helper — PKCE verifiers and challenges, state, nonce, and checking what came back
- Regex Tester — Test patterns, inspect groups and preview replacements
- User-Agent Parser — Identify the browser, engine, operating system and device behind a User-Agent string
- HTTP Status Codes — Look up what a status code means, when to send it, and whether it is cached or safe to retry
- HTML to JSX — Convert HTML and SVG markup into JSX for React, with styles, attributes and whitespace handled
- Semver Checker — Test versions against npm ranges, sort them by precedence, and see what each bump produces
- Cookie Parser and Builder — Read Set-Cookie and Cookie headers, check them against browser rules, and write one for your framework