The Weinheim–Worms railway (popularly known as the Wormser Hex, "Worms witch") is a non-electrified standard-gauge railway that formerly connected Weinheim, Viernheim, Lampertheim and Worms. Freight is operated on an approximately 4 km long section from Lampertheim towards Worms.
Plans to develop the land in the Rhine Valley below the Odenwald with a railway, which started in the 1860s, always had an objective of building a connection to Worms. The original plan saw Bensheim or Heppenheim as a starting point of the Odenwald line, but the Nibelung Railway was opened in 1869 from Bensheim via Lorsch to Worms and a branch was opened from Lorsch to Heppenheim in 1903.
However, the final route was different: instead of running to Odenwald in Hesse-Darmstadt, it was built to Weinheim in Baden because it was easier to build. The construction of the Weschnitz Valley Railway from Fürth im Odenwald through the Weschnitz valley to Weinheim began in 1893 and it was opened in 1895. Construction of the Überwald Railway, which branches off the Weschnitz Valley Railway in Mörlenbach and ran via Wald-Michelbach to Wahlen, began in 1998 and it was opened in 1901.
In order to provide the originally planned connection to Worms, a link was built from Weinheim via Viernheim to Lampertheim, which opened in 1905. Traffic ran from Lampertheim over tracks built as part of the Riedbahn (see Mannheim–Frankfurt railway) in 1877.
However, traffic on this link was not very great, since, against expectations, a majority of the traffic ran to and from the metropolitan area of Mannheim. There was also strong competition with the OEG, which operates a metre gauge railway from Weinheim via Viernheim to Mannheim.