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

HTML Minifier

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


    // setup the URL, the CSS and the form data
    $url = '';
    $html = file_get_contents('./index.html');
    $data = array(
        'input' => $html,

    // init the request, set some info, send it and finally close it
    $ch = curl_init($url);

    curl_setopt($ch, CURLOPT_POST, 1);
    curl_setopt($ch, CURLOPT_POSTFIELDS, $data);
    curl_setopt($ch, CURLOPT_RETURNTRANSFER, true);

    $minified = curl_exec($ch);


    // output the $minified
    echo $minified;


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