The thalweg (German: thal "valley" + weg "way", "path") of a river is the deepest part of its channel, where the water flows the fastest. Sometimes the thalweg is in the middle of the channel, but more often it is not. Sometimes, the thalweg can be right against one of the river banks (such as on the outside of a meander).

When a valley is too small to have a surface stream draining it, a line tracing the lowest points in the valley will also be called a "thalweg" for the valley.

Sometimes, two political jurisdictions which border on a river, or two landowners whose properties border on a river, will define their boundaries as following the thalweg of a river, but this lets them in for trouble in the future. Since rivers meander and cut off oxbow lakes, the location of the thalweg is constantly changing. If the boundary is simply defined as the "thalweg", the boundary would legally change with the river. A famous case analogous to this involves West Piedmont, West Virginia, a paper mill town on south side of the upper Potomac River, which suddenly found itself on the north side of the Potomac after WESTVACO diverted the river. The case went all the way to the Supreme Court, which decided that because of the boundary agreement between West Virginia and Maryland, the town was now Luke, Maryland.

To forestall such occurrences, jurisdictions that border each other on a river will now define their boundaries as the thalweg of a stream at a particular point in time or, what is essentially the same thing, as a surveyed line representing the course of the river at a particular point in time.