We developed a method for altering terrain unevenness on a treadmill to study gait kinematics. We attached rigid polyurethane disks (12.7 cm diameter, 1.3-3.8 cm tall) to the treadmill belt using hook-and-loop fasteners. We tested four terrain conditions: Flat, Low, Medium, and High. The main objective was to test the hypothesis that increasing the unevenness of the terrain would result in greater gait kinematic variability. We tested 17 younger adults (age 20-40 years), 25 higher-functioning older adults (age 65+ years), and 29 lower-functioning older adults (age 65+ years, Short Physical Performance Battery score < 10). We customized the treadmill speed to each participant’s walking ability, keeping the speed constant across all four terrain conditions. Participants completed two 3-minute walking trials per condition. Using an inertial measurement unit placed over the sacrum and pressure sensors in the shoes, we calculated the stride-to-stride variability in step duration and sacral excursion (coefficient of variation; standard deviation expressed as percentage of the mean). Participants also self-reported their perceived stability for each condition. Terrain was a significant predictor of step duration variability, which roughly doubled from Flat terrain to High terrain for all participant groups: younger adults (Flat 4.0%, High 8.2%), higher-functioning older adults (Flat 5.0%, High 8.9%), lower-functioning older adults (Flat 7.0%, High 14.1%). Similarly, all groups exhibited significant increases in sacral excursion variability for all three uneven terrain conditions compared to Flat. Participants were also significantly more likely to report feeling less stable walking over uneven terrain. These findings support the hypothesis that altering terrain unevenness on a treadmill will increase gait kinematic variability and reduce perceived stability in younger and older adults.