The thalweg in loess hill area is an important terrain structural line, reflecting topography and landform character. A case study is conducted in Jiuyuan valley of Suide county,north Shaanxi province. The principles and methods of disiiliing automatically thalweg are discussed in the context of a DEM,and the precision of results relative to charts and terrain maps is analyzed. The study shows that the technology and method of distilling the thalweg using DEM are practical and effective.