Loadingβ¦
Loadingβ¦
Beautify JavaScript, JSX, and TypeScript with Prettier, or minify JavaScript with terser β compress, mangle names, and keep license comments. Errors show the line and column.
Also covers: JavaScript formatter Β· JavaScript beautifier Β· JavaScript minifier Β· JS minifier Β· TypeScript formatter
The result appears here as you type.
Paste JavaScript, JSX, or TypeScript, drop a file, or click Sample.
Format runs Prettier with your choice of indentation, line width, semicolons, and quotes. Minify runs terser: it removes whitespace and dead code and shortens local variable names.
The footer shows the size before and after. Copy the output or download it as .js or .min.js.
In a module or bundle, top-level names are private to the file, so terser can shorten them too. In a classic <script>, top-level functions and variables are globals other scripts may call, so they're kept unless ES module is on.
No. Minifiers work on JavaScript, so compile TypeScript first with tsc, esbuild, or your bundler. Formatting supports TypeScript and TSX.
terser is the minifier used by webpack, Vite, and Next.js, and it keeps behavior the same for standard code. Code that reads function names at runtime (Function.name, some dependency-injection setups) can break when names are mangled β turn off Shorten names for that.
Open-source licenses such as MIT require their notice to stay with the code. Comments starting with /*! or containing @license or @preserve are kept by default.
No. Everything runs in your browser tab, and nothing you paste or open is uploaded or stored.
Data
Format, validate, and minify JSON in your browser. Paste it, upload a file, or load it from a URL. Errors show the exact line and column.
C# / .NET
Paste JSON and get C# model classes or records, ready for System.Text.Json or Newtonsoft.Json. Nested objects, arrays, nullable types, dates, and GUIDs are inferred for you.
SQL
Format and beautify SQL queries for SQL Server (T-SQL), PostgreSQL, MySQL, Oracle, and more. Set the indentation, keyword case, and layout, and get the exact line of any syntax error.
Data
Format, validate, and minify XML (config files, .csproj, SOAP, RSS) in your browser. Entities, CDATA, and mixed content are kept exactly as written, and errors show the line and column.
Data
Format and validate YAML (docker-compose, Kubernetes, GitHub Actions) without losing comments, or convert YAML to JSON. Errors show the exact line and column.
Web
Beautify HTML pages and fragments without changing how they render. Inline spacing, <pre>, and scripts stay intact, and embedded CSS and JavaScript can be formatted too.