Private by design
Minification happens in your browser. Your CSS is never uploaded, stored or logged.
Free · No sign-up · Runs in your browser
Shrink your stylesheets for production in one click. Merge rules, remove whitespace and comments, see exactly how many bytes you saved, then copy or download the .min.css file.
Minification happens in your browser. Your CSS is never uploaded, stored or logged.
Beyond whitespace removal: merges duplicate rules, shortens colors and values, and drops overridden declarations.
Drop several stylesheets at once. They are merged in order into a single .min.css file.
See original, minified and gzipped sizes side by side, so you know what your users actually download.
Need to read a minified stylesheet? One click turns it back into neatly indented CSS.
Minify from your build pipeline, CMS or Classic ASP app with one POST request. No key needed.
Automate minification from your build scripts, CI or CMS with a single HTTP request. No key required.
POST https://cssminify.org/api/input: your CSS (form-urlencoded)format=json for sizes and savings, license=0 to also drop /*! */ commentstext/css with the minified code, or 400 and the error textThe API uses our lightweight server engine (comment and whitespace removal). The browser tool above applies the full csso optimiser.
curl -X POST https://cssminify.org/api/ \
--data-urlencode "[email protected]" \
-o style.min.css
# sizes and savings as JSON
curl -X POST https://cssminify.org/api/ \
--data-urlencode "[email protected]" -d format=json
const res = await fetch("https://cssminify.org/api/", {
method: "POST",
body: new URLSearchParams({ input: code })
});
if (!res.ok) throw new Error(await res.text());
const minified = await res.text();
$ch = curl_init("https://cssminify.org/api/");
curl_setopt_array($ch, [
CURLOPT_POST => true,
CURLOPT_POSTFIELDS => http_build_query(["input" => $code]),
CURLOPT_RETURNTRANSFER => true,
]);
$minified = curl_exec($ch);
curl_close($ch);
import requests
r = requests.post("https://cssminify.org/api/", data={"input": code})
r.raise_for_status()
minified = r.text
<%
Session.CodePage = 65001
Set http = Server.CreateObject("MSXML2.ServerXMLHTTP.6.0")
http.Open "POST", "https://cssminify.org/api/", False
http.setRequestHeader "Content-Type", _
"application/x-www-form-urlencoded; charset=utf-8"
http.Send "input=" & Server.URLEncode(code)
minified = http.responseText
%>
It removes everything the browser does not need to read your stylesheet: comments, line breaks, indentation and extra spaces. It also rewrites values in shorter forms, for example #ff0000 becomes red and 0px becomes 0. The result looks the same in the browser but downloads faster.
Yes. The default settings only apply transformations that keep your page looking exactly the same. If you rely on a very unusual cascade trick, untick Restructure to keep the original rule order.
No. With JavaScript enabled, everything runs locally in your browser. Only if JavaScript is turned off does the form fall back to our server, which minifies the code in memory and does not keep it.
Typically 15 to 40 percent before compression, depending on how much whitespace, how many comments and how many duplicate rules your stylesheet has. The stats panel shows the exact saving and the gzipped size.
Yes. Comments that start with /*! are kept by default, because licenses often require it. Untick Keep /*! comments to remove them too.
Yes. Select or drop several .css files and they are combined in the order you added them. You can remove any file from the list before downloading.
Comments and your original formatting cannot be recovered, but the Beautify button reformats minified CSS with indentation and line breaks so it is easy to read again.