Pretty-print or minify JavaScript instantly in your browser, correctly handling strings, template literals, regex, and comments.
Updated
/ 5 - Be the first to rate this tool Thanks for rating!
Verification failed - please try again.
Quick check
Please verify you're not a robot to submit your rating.
Give feedback
Tell us what you think about Format and minify JavaScript online.
- Runs entirely in your browser — your code is never sent to a server
- Correctly handles strings, template literals, regex, and comments
- Free, no account required
How it works
-
1
Paste the code or data you want to format.
-
2
Choose pretty-print or minify, and set the indent width if you like.
-
3
The formatted result updates instantly.
-
4
Copy the result, or download it as a file.
Why use this tool
Every dev utility, one place
Format, convert, encode, decode, and generate — no more juggling ten tabs.
100% private, always
Every tool runs in your browser — your code and data are never sent anywhere.
Works on any device
Runs on Windows, Mac, Linux, iOS, and Android — nothing to install.
Instant results
No queues, no build step — results update as you type.
Built to handle real data
Full Unicode support and RFC-compliant parsing, edge cases included.
Free, always
Free to use, with no rate limits, sign-up, or trial period.
Frequently asked questions
It is a heuristic beautifier meant for quick readability; it is not a full AST replacement like Prettier.
It maintains the author's style; it will not inject missing semicolons where automatic insertion applies.
Arrow functions, template literals, and destructuring are fully recognized and spaced appropriately.
No, this only removes whitespace and comments. It does not shorten or mangle internal variables.
It works best on standard JavaScript; complex React JSX syntax might produce inconsistent indentation.
From the blog
Reading a JWT Without Trusting It: Claims, Expiry, and the Signature Trap
Decoding a JWT takes a second. Verifying one is a different job entirely — and confusing the two is how auth bugs ship. Here is how to read a token safely while you debug.
Mastering Base64: What It Is, How It Works, and When Not to Use It
Base64 is everywhere in modern web development, from data URIs to authentication headers. Here is a deep dive into how it works and common pitfalls to avoid.
Demystifying JSON: How to Troubleshoot Common Parsing Errors
JSON is the backbone of web APIs, but syntax mistakes can halt your code. Here is how to identify and fix missing commas, unescaped strings, and trailing characters.
Recently viewed
Generate a .gitignore file online
Pick languages, frameworks, and editors to instantly build a combined .gitignore file, in your browser.
Format and validate JSON online
Paste JSON to pretty-print, minify, and validate it instantly in your browser.
Generate MD5 and SHA hashes online
Compute MD5, SHA-1, SHA-256, SHA-384, and SHA-512 hashes of any text in your browser.
Related tools
Format and minify CSS online
Pretty-print or minify CSS instantly in your browser, with adjustable indentation.
Format and beautify HTML online
Pretty-print or minify HTML instantly in your browser, with adjustable indentation.
Format and validate JSON online
Paste JSON to pretty-print, minify, and validate it instantly in your browser.
Format and beautify SQL online
Pretty-print or minify a SQL query instantly in your browser, with clause-based line breaks.
Format and beautify XML online
Pretty-print or minify XML instantly in your browser, with adjustable indentation.
Format and re-indent YAML online
Normalize inconsistent YAML indentation to a consistent width instantly in your browser.
Validate JSON against a JSON Schema
Paste a JSON document and a JSON Schema to see every validation error with its instance path. Supports draft 2020-12 and draft-07, entirely in your browser.
Generate TypeScript interfaces and PHP classes from JSON
Paste JSON and get TypeScript interfaces or PHP classes with typed properties, including nested objects and arrays, instantly in your browser.
Decode a JWT online
Paste a JSON Web Token to instantly view its decoded header and payload in your browser.
Build and sign a JWT online
Build and HMAC-SHA256-sign a JWT from a header, payload, and secret, instantly in your browser.
Sort and de-duplicate lines online
Sort lines alphabetically or by length, remove duplicates, and strip blank lines, instantly in your browser.
Resize an image to LinkedIn post size for free
Fit or fill an image to the 1200×627 LinkedIn post size, with drag-to-reposition and zoom, right in your browser.