The invention discloses a dyeing machine. The dyeing machine comprises a fabric conveying pipe, wherein a fabric storage tank is arranged being a certain distance away from the bottom of the fabric conveying pipe, a sealing door capable of sealing the fabric conveying pipe is arranged at one side of the fabric conveying pipe, the fabric conveying pipe is connected with a charging tank, where a pigment is placed, through a charging pump, and the fabric conveying pipe is connected with a heat exchanger through a circulating pump. The dyeing machine is characterized in that a fabric conveying roller and an overflow spray nozzle are sequentially arranged at one side, close to the sealing door, of the fabric conveying pipe, a compacting block which is used for fixedly compacting a rope-shaped fabric is arranged at the top of one side, far away from the sealing door, of the fabric conveying pipe and moves through an air cylinder, the head and tail ends of the rope-shaped fabric are connected, and the rope-shaped fabric sequentially passes through the compacting block, the overflow spray nozzle, the fabric conveying roller, the fabric storage tank and the compacting block and is subjected to circulated dyeing in the fabric conveying pipe. According to the dyeing machine, the traditional dyeing machine is improved, the times of circulating can be reduced under the condition of obtaining the same dyeing effect, the dyeing efficiency of the dyeing machine is increased, and the dyeing uniformity of the dyeing machine is improved.