Emerging heavy duty vehicle control systems increasingly rely on advance knowledge of the road topography, described by the longitudinal road grade. Highway road grade profiles are restricted by road design specifications to be piecewise affine. This characteristic is used herein to derive a method for road grade estimation based on standard on-vehicle sensors and optimal piecewise linear estimation through dynamic programming. The proposed method is demonstrated with on-road experiments. It is able to represent the road grade profile for two studied 15 km road sections, by 20 linear segments for each, with a root mean square error between 0.42 % and 0.55 % grade.