Minify your CSS

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

Written and hosted by Andrew Chilton (@andychilton).


Thanks to Boris Kotyrev (I've adapted what he sent to be more minimal).

use strict;
use warnings;

use File::Slurp;
use HTTP::Request::Common qw(POST);
use LWP::UserAgent;

sub minify{
    my ($css) = @_;

    my $css_min_url = "";

    my $ua = LWP::UserAgent->new;
    my $request = POST($css_min_url, [ 'input' => $css ]);
    my $css_min = $ua->request($request)->decoded_content();

    return $css_min;

print minify($css, "\n");

Language Examples

Click on the language of your choice:

wget Curl Node.js Python Ruby Perl PHP C# Rust Kotlin

More Languages

I'd love to add more examples in your favourite programming language, so feel free to send them my way. Email andychilton at that gmail place in the sky or tweet to me @andychilton.