The Neckarelz–Osterburken railway is a 30.9 km long railway line in the north of the German state of Baden-Württemberg, which connects the Neckar and the Bauland along the edge of the Odenwald. It was opened in 1866 as part of the Odenwald Railway (Baden) (Odenwaldbahn) between Heidelberg and Würzburg. It has been upgraded to form an entirely double-track and electrified main line railway. It was an east–west axis for German long-distance transport until 1945. Since 2003 passenger services on it have been operated by the Rhine-Neckar S-Bahn. The Neckarelz–Mosbach section has also been served by the Heilbronn Stadtbahn since 2014.