A water hammer cleaning machine has a cleaning liquid supply piping line with a pump to press cleaning liquid therethrough and an air piping line with compressor to press air therethrough to a piping line to be cleaned. An automatic opening-closing valve on the air piping line opens or closes the air piping line to clean alien substances inside of the piping line with the cleaning liquid and with a shock wave of resulting oscillation.