Chris Collins

Tools · dev

Code beautifier and minifier

Beautify or minify JavaScript, TypeScript, JSON, CSS/SCSS/LESS, HTML, and XML, with indentation, wrapping, and brace-style options and before/after sizes.

Added

How to use it

Paste code, leave Language on auto-detect (or pick one), and press Beautify (Cmd/Ctrl+Enter) or Minify (Cmd/Ctrl+Shift+M). The status line shows the size change.

  • Beautify uses js-beautify: indent width or tabs, line wrapping, brace style (including Allman), how many blank lines to keep, and how HTML attributes wrap.

  • Minify uses Terser for JavaScript (compress and mangle, ES modules detected automatically), CSSO for CSS, and local minifiers for HTML (comments and inter-tag whitespace removed, boolean attributes shortened, inline scripts and styles minified, <pre> and <textarea> left alone), XML, and JSON.

  • Keep /! licence / comments preserves licence headers when minifying.

  • SCSS and LESS are beautified properly; minifying treats them as plain CSS, so compile them first for exact results.

Libraries load from jsdelivr on first use; your code stays in the page.

Sharing

Share link copies a URL that opens this tool exactly as you have it. Hand-written links work too: ?lang=css&code=… (lang: auto, js, ts, json, css, scss, less, html, xml). Non-default formatting options travel packed. For example ?lang=json&code=%7B%22a%22%3A1%2C%22b%22%3A%5B1%2C2%5D%7D.

Runs entirely in your browser — network requests go only to the services named on this page.