Mg-doped LaCoO3 nanocrystals are prepared by a modified sol-gel method. Excess MgO is used to inhibit the crystal growth and agglomeration during the calcination process. A series of Mg-doped LaCoO3 nanocrystals with average crystallite size varying from 13.4 to 31.6 nm can be obtained by changing the molar ratio of Mg:La from 4:1 to 1:10 in the reaction mixture. The largest BET surface area observed is 64.5 m2/g if the molar ratio of Mg:La is 4:1. The product can be well dispersed in water and a very stable colloid formed without any stabilizer. The photocatalytic performance of Mg-doped LaCoO3 nanocrystals is evaluated by the degradation of Reactive Brilliant Red X-3B solution. The well-dispersed Mg-doped LaCoO3 nanocrystals exhibit high visible-light photocatalytic activity.