No upload, 100% local, no account

Minify / Beautify

Minify or beautify code. Everything stays in your browser.

How Minify / Beautify works

Minify / Beautify compresses HTML, CSS, and JavaScript by removing comments, unnecessary whitespace, and redundant characters, or expands minified code back into a readable indented form. All processing happens in the browser using bundled parsers; nothing you paste is transmitted anywhere. Nothing you type here leaves your device.

Minification directly affects page load performance: smaller files transfer faster, parse faster, and consume less bandwidth. For production deployments, minified assets are standard. This tool is useful when you receive a minified file you need to read (beautify), when you want to check what a minifier does to a snippet before integrating it into a build pipeline, or when you need a quick one-off minification without setting up a build tool.

How to use Minify / Beautify, step by step

  1. Paste your HTML, CSS, or JavaScript code into the input area.
  2. Select the language type from the dropdown (HTML, CSS, or JavaScript).
  3. Click 'Minify' to produce the compressed version, or 'Beautify' to expand and indent the code.
  4. Copy the result from the output area using the copy button.
  5. Paste different code and repeat as needed.

Common use cases

  • A frontend developer wants to minify a critical CSS snippet to inline it in the HTML head for above-the-fold performance.
  • A developer receives a minified third-party script and needs to beautify it to understand its logic during a security review.
  • A technical writer needs a prettified version of a minified JSON-LD script tag to include in documentation.
  • A web developer checks the byte savings from minifying a CSS file before deciding whether to add a build step.

Frequently asked questions

Is the code I paste sent to any server for minification?

No. The minification and beautification are done by the page's own code, written for this tool rather than pulled from a third-party minifier. All processing stays in the browser tab. Nothing you paste here is transmitted to Sunasty or any third party.

Does JavaScript minification preserve the original behaviour of the code?

A good minifier preserves behaviour by only removing whitespace, shortening variable names within a controlled scope, and stripping comments. This tool targets safe transformations. Aggressive optimisations like dead-code elimination or function inlining are generally not applied, since those require full program analysis.

Can I minify and then beautify the result to verify it?

Yes. Minify the code first, then paste the minified output back into the input and click Beautify. The beautified version will look different from the original source (variable names may be shortened, comments removed) but will be structurally equivalent.

Does HTML minification remove all comments?

The tool strips standard HTML comments (<!-- ... -->) during minification. Conditional comments used by old IE versions (<!--[if IE]...-->) are always kept, so removing comments cannot break legacy behaviour that depends on them.

Is there a size limit on the code I can minify?

The limit is your browser tab's available memory. Code up to a few hundred kilobytes processes quickly. For large JavaScript bundles (megabytes), a dedicated build tool like esbuild, Terser, or Lightning CSS is faster and more appropriate for production use.