🗜️

CSS Minifier & Beautifier

Compact or beautify CSS while preserving strings and declaration order.

Advertisement

Choose “Compact” or “Beautify” in “Mode”, paste CSS and use “Run”; editing also updates the result. Method and limits

Bytes:

Options

Bytes:

Input (Bytes)
Output (Bytes)
Signed savings

Dependency licenses

Method and limits

Method and limits

CSS is parsed with css-tree 3.1.0 before generation. Minify conservatively compacts syntax; Beautify uses two-space structural indentation. Declaration and fallback order, strings such as "/*literal*/", calc operator spaces and custom-property token spacing are preserved. Ordinary comments may be removed; /*! license comments */ are retained. Hex colors and numeric values are not deliberately shortened. Invalid recovered syntax and SCSS/LESS interpolation are rejected. This does not validate browser compatibility.

Tool input is processed locally in a worker, without uploads, storage or source logging. Ads and the rest of the site may make network requests. Assets must load first; offline operation is not guaranteed.

Input 1 MiB UTF-8; output 2 MiB; 5 s including loading. CSS/HTML: depth 128, nodes 50000. Worker termination mitigates resources; it is not heap isolation.

Copied

Copy failed. Select the result and copy it manually.

Embed this tool on your website

Use whole pixel dimensions from 1 to 4096.

× px (1–4096)

                        

💡 Integration Tip

Copy the embed code and paste it into your website HTML. The responsive version adapts to all screen sizes automatically.

2 ratings
✓

About CSS Minifier & Beautifier

Compact or beautify CSS while preserving strings and declaration order.

A beautify mode does the reverse, re-indenting a compressed stylesheet one declaration per line. It reports the original and minified byte size along with the percentage saved, which is what you want when trimming render-blocking CSS, and the output copies or downloads as styles.min.css for compact output or styles.css for beautified output. Everything runs in your browser.

a::before { content: "/*literal*/"; width: calc(100% - 2px); }

Versioned technical method; no calendar or legal reference year applies.

Use Cases

Developers and QA engineers inspecting, validating, or transforming data using the CSS Minifier.
DevOps practitioners debugging configuration files, tokens, or API responses on the fly.
Students learning web development, data formats, or encoding schemes with a hands-on CSS Minifier.
Technical writers preparing code samples, configuration examples, or documentation assets.
Security researchers and bug bounty hunters who need a quick sandbox without CLI access.

How to use

1

Paste CSS into “Input”, or use “Load sample” to load an example.

2

Choose “Compact” or “Beautify” in “Mode”, paste CSS and use “Run”; editing also updates the result.

3

Select “Beautify” in “Mode” for two-space indentation and one declaration per line.

4

Watch the output pane rewrite itself as you type and compare the byte counts shown above each box.

5

Use “Copy” for the clipboard or “Download” to save (styles.min.css for compact output or styles.css for beautified output). Use “Clear” to empty the draft and result; “Cancel” stops current work.

Pro Tips

  • Use keyboard shortcuts (Ctrl/Cmd+A to select all, Ctrl/Cmd+C to copy) to speed up your workflow inside the CSS Minifier.
  • The CSS Minifier does not log or store your input. If you need history, copy important outputs to a local file or note app.
  • Review warnings and the output before copying. A successful transform is not proof of compatibility with your application.

Frequently Asked Questions

CSS is parsed with css-tree 3.1.0 before generation. Minify conservatively compacts syntax; Beautify uses two-space structural indentation. Declaration and fallback order, strings such as "/*literal*/", calc operator spaces and custom-property token spacing are preserved.

Ordinary comments may be removed; /*! license comments */ are retained. Hex colors and numeric values are not deliberately shortened. Invalid recovered syntax and SCSS/LESS interpolation are rejected. This does not validate browser compatibility.

Popular Tools

No more tools to show
Explore All Tools
FreeWebTools AI