Described is a method for cleaning a machine (1) for liquid or semi-liquid products, the machine (1) comprising: - a first container (3) intended to contain a liquid or semi-liquid basic mixture or finished product and also provided with related means (5) for thermal treatment of the liquid or semi-liquid basic mixture or finished product and a mixer (4), the method comprising, in time sequence, the following steps: - a) emptying the basic mixture contained in the first container (3); - b) washing said first container (3) with a washing fluid; - c) at least partly filling the first container (3) with a cleaning fluid and subjecting the cleaning fluid in the first container (3) to a pasteurising thermal treatment.