This paper presents a wearable inertial pedestrian navigation system and its associated pedestrian trajectory reconstruction algorithm for reconstructing pedestrian walking trajectories in indoor and outdoor environments. The proposed wearable inertial pedestrian navigation system is constructed by integrating a triaxial accelerometer, a triaxial gyroscope, a triaxial magnetometer, a microcontroller, and a Bluetooth wireless transmission module. Users wear the system on foot while walking in indoor and outdoor environments at normal speed without any external positioning techniques. During walking movement, the measured inertial signals generated from walking movements are transmitted to a computer via the wireless module. Based on the foot-mounted inertial pedestrian navigation system, a pedestrian trajectory reconstruction algorithm composed of the procedures of inertial signal acquisition, signal preprocessing, trajectory reconstruction, and trajectory height estimation has been developed to reconstruct floor walking and stair climbing trajectories. In order to minimize the cumulative error of the inertial signals, we have utilized a sensor fusion technique based on a double-stage quaternion-based extended Kalman filter to fuse acceleration, angular velocity, and magnetic signals. Experimental results have successfully validated the effectiveness of the proposed wearable inertial pedestrian navigation system and its associated pedestrian trajectory reconstruction algorithm.