JavaScript Formatter
Beautify JavaScript, TypeScript or JSX, or minify it with Terser. More data tools
Format and minify JavaScript
Beautify uses the Prettier formatter. Tick TypeScript / JSX input for those files. Minify uses Terser to compress the code and optionally shorten variable names, and shows the size before and after.
Syntax errors are reported with the line and column, so you can fix them before you minify.
Features
- Live: the result updates while you type.
- Clear errors: the line, the reason and, where possible, a one-click fix.
- Open and drop files, copy or download the result, and share your input as a link.
- Send to another tool: pass the result straight to a related tool.
- Private: Everything runs in your browser. Your data is not uploaded to any server.
Related data tools
- YAML Formatter: Tidy YAML and check it. Comments are kept.
- XML Formatter: Beautify, minify and validate XML. Errors show the exact line.
- SQL Formatter: Make long SQL queries readable, or minify them. Pick your database.
- HTML Formatter: Beautify or minify HTML. Embedded CSS and JavaScript are formatted too.
- CSS Formatter: Beautify CSS, SCSS or LESS, or minify CSS. Errors show the line.
- CSV Viewer: Open a CSV as a table. Click a column to sort and use the box to filter rows.
- All DataMint tools
Frequently asked questions
Is the minified code safe?
Terser is a widely used production minifier. Test the result as you would any build output.
Can it format TypeScript?
Yes. Tick the TypeScript / JSX box.
Is my data private?
Everything runs in your browser. Your data is not uploaded to any server. You can even use the tool offline once the page has loaded.