AbstractI present a calculus variations problem for an optimal zero‐moment point (ZMP) pattern, and derive a closed‐form solution satisfying two‐boundary conditions of ZMP and an additional constraint, which is a difference between a current capture point and another. In addition, I present a closed‐form solution for the equation of motion of the linear inverted pendulum model, or a cart‐table model using the optimal ZMP pattern. Through the closed‐form solutions, a current walking pattern is generated with every step period, and is connected with a previous pattern without discontinuity. I demonstrate my optimal walking pattern generator with 13 forward steps, and compare power consumption with walking, using a linearly interpolated ZMP pattern for effectiveness. Moreover, I indicate the walking pattern changes in real‐time, depending on varying step lengths.