KiwiRail runs regular freight services along the line between Wellington to Masterton and between Pahiatua and Woodville.
[5] Proposals for railed transportation out of Wellington were made as early as the start of the 1850s, barely a decade after European settlement of the area began.
[8] The act authorised a railway employing either 3 ft 6 in (1,067 mm) or 1,435 mm (4 ft 8+1⁄2 in) standard gauge to carry 200 tonnes at speeds of 24 kilometres per hour (15 mph), but construction did not commence as sufficient funds were not available in the fledgling New Zealand colony, nor were they successfully raised in England.
On 20 August 1872, construction of the Wairarapa Line began with the turning of the first sod at Pipitea Point, the site of Wellington's first railway station.
Construction was delayed due to the difficulties associated with building a railway along the narrow, rocky shoreline of Wellington Harbour, and the section to Lower Hutt was not opened until 14 April 1874.
[9] On 1 January 1878 the line to Kaitoke was opened to the public; becoming the railhead for the Wairarapa for nearly ten months (to 16 October).
[10] The Rimutaka Range posed a severe difficulty to those involved in planning and constructing the Wairarapa Line.
This used a centre rail to which specially-designed locomotives and brake vans clung, allowing them to climb the steep slope upwards or control the descent.
In 1925, construction began on what was then known as the Hutt Valley Branch, leaving the main line just north of Petone station and running east to Waterloo, opening on 26 May 1927.
After World War II, new state housing suburbs developed north of Waterloo, and the railway was extended to serve them.
The deviation included a new bridge across the Hutt River, replacing a section of line now used by Silver Stream Railway The Rimutaka Incline was difficult, costly and time-consuming to operate, but as the Wairarapa Line had become a secondary route since the acquisition of the Wellington and Manawatu Railway in 1908, its replacement was not a priority.
However, the economic conditions left from the Great Depression followed by the impact of World War II meant that work on the tunnel did not start until 1948.
The Incline and the line up the western side of the Rimutakas closed on 29 October 1955 and the tunnel opened on 3 November 1955.
In the 1950s, the Hutt Valley line was electrified using the 1500 V DC system already operating from Wellington to Johnsonville and Paekākāriki.
The electrification was opened to Taitā on 12 October 1953 and Upper Hutt on 24 July 1955, allowing for a more intensive suburban commuter service to Wellington.
The "Matangi" FP/FT class was introduced on the Hutt Valley Line in 2011–12, initially relegating the Ganz Mavag units to peak services only before being completely replacing them from 2015.
Passenger services through the lowly populated northern Wairarapa survived due to the poor roads in the area, but as they were improved, demand for the trains declined.
Masterton – Palmerston North passenger trains ceased from Monday, 1 August 1988[11] with the last such service running on Friday, 29 July.
The Wellington Metro Rail Upgrade project (2020-2021) started in November 2019; and is expected to take eighteen months and cost $300 million.
The work is expected to improve the operation of both suburban passenger trains to Upper Hutt and the Wairarapa Connection.
Two freight trains operate from Palmerston North to Pahiatua and return on weekdays, the first in the early hours of the morning and the second in the afternoon.
The Masterton—Pahiatua section will be temporary reopened between December 2024 and February 2025 to enable the Waingawa logging traffic to be diverted via Woodville and Palmerston North, due to track upgrades requiring a 46-day closure of the Remutaka Tunnel.
Until 1967, the Wairarapa Line was the only way DA class locomotives could access Wellington due to tunnels south of Paekākāriki being too small.
[23] Proposals have been made to extend the electrification into the Wairarapa and the Rimutaka Tunnel was constructed to allow overhead lines to be installed, although before opening diesel operation was adopted.
In 2007, the Greater Wellington Regional Council rejected a call for the line to be electrified to Masterton, stating that patronage was too low to justify the capital expenditure.
In November 2013, the GWRC voted to close it permanently as on health and safety grounds, it was too expensive and nearly impossible to upgrade the station to provide step free access via ramps for disabled passengers.
[27] Extensive sidings at Petone, Naenae (where the goods shed remains, in non-rail use), Taitā (Unilever) and Trentham (Army) have been closed and removed.
Of these, only three are now in use for railway purposes, and only the Wiwaka tunnel in northern Wairarapa (150m; between Mangamahoe & Eketahuna) has remained unaffected by deviations since the line opened.