This paper proposes a systematic process to analyze the mechanical error and to synthesize the tolerances for individual dimensions of spatial cam mechanisms. The mathematical expressions of geometry surface of the cam are determined by the generating method. Based on these expressions and Taylor's series expansion, the output variables are expressed by sensitivity factors and the mean of design variables. And, the mechanical error is also calculated according to the measured coordinate data on the manufactured cam surface and misalignments. By applying statistics and cost-tolerance function, the objective function subjected to the variance of the assembly tolerance is established. Then, the Lagrange multiplier is involved to synthesize the optimum tolerances with the least manufacturing cost. A numerical example is given.