In 1631 construction began and the canal was dug in a virtually straight line to guarantee the shortest route.
Until that time, boats needed to travel up the Spaarne river to pass the narrow sluice gate at Spaarndam, to reach the IJ.
Prior to this route, coaches traveling by land would leave Haarlem over the Oude Weg up to the Liede, where they would cross at Penningsveer (a ferry for a penny), to Spaarnwoude and along the IJdijk (on older maps, Spaarndammerdijk) to Amsterdam.
The success of the Haarlemmertrekvaart led to the extension of the canal from Haarlem to Leiden by means of the Leidsevaart in 1657.
A railway parallel to the canal was built in 1839 which rendered passenger transport on the Haarlemmertrekvaart obsolete.