The line was opened by the private Yokohama Railway (横浜鉄道, Yokohama Tetsudō) on 23 September 1908 and leased to the government in 1910.
The line was nationalized on 1 October 1917.

The Higashi-Kanagawa to Haramachida (now Machida) section was electrified on 1 October 1932, with the Haramachida to Hachiōji section electrified on 14 April 1941.

The Higashi-Kanagawa to Kozukue section was double-tracked by 1968, extended to Aihara by 1980, and completed to Hachiōji on 6 March 1988.
The line was opened by the private Yokohama Railway (横浜鉄道, Yokohama Tetsudō) on 23 September 1908 and leased to the government in 1910. The line was nationalized on 1 October 1917.
The Higashi-Kanagawa to Haramachida (now Machida) section was electrified on 1 October 1932, with the Haramachida to Hachiōji section electrified on 14 April 1941.
The Higashi-Kanagawa to Kozukue section was double-tracked by 1968, extended to Aihara by 1980, and completed to Hachiōji on 6 March 1988.
Yokohama Line