The leg mechanism of a walking machine has a strong influence on the performance of the machine. A successful leg mechanism should be energy efficient, compact in size, strong and simple. In order to achieve good energy efficiency, a walking machine leg should be able to generate an exact or approximate straight line at the foot with only one driving actuator. This paper deals with the synthesis and analysis of a new leg mechanism — the planetary gear leg mechanism. Four types of planetary gear legs are studied. By the SUMT optimization method, a 20 inch tall leg is able to generate an approximate straight line trajectory with a maximum deviation of 0.12805 inches in a 20 inch stroke. The direct and inverse kinematics and velocities of the legs are analyzed. Also, the distribution of actuator force/moment during walking are studied. The results show that this leg design has great potential to be used as a practical walking machine leg.