This site has been acquired by
(Attention! API endpoint has changed)

CSS Minifier

Online CSS Minifier/Compressor. Free! Provides an API. Simple Quick and Fast.


Credits: Thanks to Cristian Tomatis for contributing this example.

import requests

url = ''
data = {'input': open('style.css', 'rb').read()}
response =, data=data)

print response.text

Python - from the REPL

Credits: Thanks to Noam Yorav-Raphael for contributing this example.

>>> import requests
>>>'', data=dict(input='p { color : red; }')).text

Python - a CLI tool

Credits: Thanks to Kyle S. for contributing this to the site.

# -*- coding: utf-8 -*-
import sys
import requests

    css_file = sys.argv[1]
    print("Missing input file")

# Grab the file contents
with open(css_file, 'r') as c:
    css =

# Pack it, ship it
payload = {'input': css}
url = ''
print("Requesting mini-me of {}. . .".format(
r =, payload)

# Write out minified version
minified = css_file.rstrip('.css')+'.min.css'
with open(minified, 'w') as m:

print("Minification complete. See {}".format(

Click on the language of your choice to see an example: