This paper describes an online walking pattern generation using preview control. Before a robot starts walking, the first 3-step walking pattern is generated by using the pattern generation method. If a generated 3-step pattern is created, it will be connected with the previous step using linear interpolation. The first walking pattern is connected with the second walking pattern when the ZMP (Zero Moment Point) is in the center of the support polygon formed by both feet. When the robot stops, the last 3-step pattern is performed. In order to verify the effectiveness of the online walking pattern generation method, various walking experiments using a biped humanoid robot are conducted.