Beautify vs minify
Beautifying (pretty-printing) adds consistent indentation, wraps long lines, and normalizes quote and semicolon style so code is easier to read and review. Minifying removes whitespace and comments, applies safe compressions, and can mangle short local variable names to shrink bundle size for production. This tool offers both flows in one place: Prettier for formatting, Terser for minification.
How this JavaScript / TypeScript tool works
Paste your source into the input panel. For Beautify, pick JavaScript or TypeScript — Prettier runs in the browser with the Babel or TypeScript parser plus Estree, using a 100-character print width and your chosen tab width (2 or 4 spaces), semicolon preference, and single- or double-quoted strings. Click Beautify to see formatted output. For Minify, switch the language to JavaScript: Terser applies compression (including dead-code elimination with a single pass), enables name mangling, strips comments, targets modern ECMAScript, and automatically treats the file as an ES module when it sees import or export syntax. TypeScript cannot be minified directly in this UI — compile to JS first or use Beautify only.
Outputs and downloads
After a successful run, copy the result or use Download to save script.js when the language is JavaScript or script.ts when it is TypeScript. Load sample fills a small example for the current language. Clear removes input, output, and status.
Privacy
Prettier and Terser execute locally in your browser. Your code is not sent to Dynamic Duniya servers for formatting or minification.