Format JavaScript and TypeScript with the same rules your editor uses.
Minified function
Compressed code with no whitespace
function sum(a,b){return a+b}const double=x=>x*2;console.log(sum(1,2),double(4))Async with promises
Chained calls that need line breaks
async function load(){const res=await fetch("/api/items");if(!res.ok)throw new Error("failed");const data=await res.json();return data.filter(i=>i.active).map(i=>i.name)}React component
JSX formatting
export function Card({title,children}){return <div className="card"><h2>{title}</h2><div>{children}</div></div>}Minified function
Compressed code with no whitespace
function sum(a,b){return a+b}const double=x=>x*2;console.log(sum(1,2),double(4))Async with promises
Chained calls that need line breaks
async function load(){const res=await fetch("/api/items");if(!res.ok)throw new Error("failed");const data=await res.json();return data.filter(i=>i.active).map(i=>i.name)}React component
JSX formatting
export function Card({title,children}){return <div className="card"><h2>{title}</h2><div>{children}</div></div>}JavaScript, TypeScript, JSX or TSX. The parser handles modern syntax including optional chaining and top-level await.
Indentation, line breaks and semicolons are normalised so the logic is legible rather than compressed.
Output matches Prettier defaults, so it will not conflict with a project that already formats on save.
Bundled or compressed source becomes something you can actually follow, which is often the fastest way to understand a third-party script.
Type annotations, generics and JSX are parsed properly rather than treated as syntax errors.
Proprietary or unreleased code is formatted locally, so pasting internal source is not a disclosure.
Paste minified, bundled or badly-indented JavaScript and get readable code back. Useful for reading a third-party snippet, tidying something copied out of a Stack Overflow answer, or checking what a bundle actually contains. TypeScript, JSX and TSX are all supported. Formatting follows Prettier’s conventions, so output matches what most projects already enforce.
Keep going
Related pages in Developer Tools, plus what others are using right now.
More developer tools that pair well with this one.
Format, validate and minify JSON, with errors that point to the exact line.
Indent messy HTML into readable, consistently structured markup.
Format and tidy CSS, SCSS and Less with consistent spacing and indentation.
Test regular expressions live, with highlighted matches and capture groups.
Indent and validate XML, with clear messages when tags do not match.
Tidy YAML indentation, validate structure and convert between YAML and JSON.
Create strong random passwords with full control over length and characters.
Work out any percentage — of a number, as a share, or as a change.
Count words, characters, sentences and paragraphs as you type.
Convert between length, weight, temperature, volume, speed, data and more.
Count characters with and without spaces, against the limits that matter.
Find the mean, median, mode and range of a list of numbers, with the working shown.
Sample and population standard deviation and variance, both shown, with the working.
Turn a logo into favicon.ico, the PNG sizes a site needs, and the HTML to declare them.
Check a downloaded file against its published checksum, without uploading anything.
Stamp text like DRAFT or CONFIDENTIAL across a PDF, in your browser.
See how savings grow with compounding, including regular contributions.
Shrink JPEG, PNG and WebP files with a quality slider and a live size comparison.