Polycrystalline Ca3-xMgxCo4O9(x=0-0.3)ceramics were prepared by the sol–gel method combined with the ordinary pressing sintering and the thermoelectric properties were measured from room temperature to 673 K. The substitution of Mg2+ for Ca2+ had a greater impact on the thermoelectric properties of Ca3Co4O9. The electrical conductivity and the thermal conductivity reduced significantly with increasing Mg content, and the Seebeck coefficient increased simultaneously. The influence of Mg doping on the thermal conductivity is mainly embodied in the lattice thermal conductivity of Ca3Co4O9. The lattice thermal conductivity showed a significant change with the increase of the dopant content, while the carrier thermal conductivity had no obvious change with the doping increasing. These results indicated that the thermoelectric properties of the material could be optimized remarkably with the substitution of Mg. The figure of merit Z reached 1.08×10-4 K-1 at 573 K for the sample of Ca2.8Mg0.2Co4O9.