Humanoid robot is the most intimate robot platform suitable for human interaction and services. Biped walking is its basic locomotion method, which is performed with combination of joint actuator’s rotations in the lower extremity. The present work employs humanoid robot simulator and numerical optimization method to generate optimal joint trajectories for biped walking. The simulator is developed with Matlab based on the robot structure constructed with the Denavit-Hartenberg (DH) convention. Particle swarm optimization method minimizes the cost function for biped walking associated with performance index such as altitude trajectory of clearance foot and stability index concerning zero moment point (ZMP) trajectory. In this paper, instead of checking whether ZMP’s position is inside the stable region or not, reference ZMP trajectory is approximately configured with feature points by which piece-wise linear trajectory can be drawn, and difference of reference ZMP and actual one at each sampling time is added to the cost function. The optimized joint trajectories realize three phases of stable gait including initial, periodic, and final steps. For validation of the proposed approach, a small-sized humanoid robot named DARwIn-OP is commanded to walk with the optimized joint trajectories, and the walking result is successful.