The Baraboo Air Line Railroad reached Elroy in the 1870s.
It eventually became the main line of the CNW between Chicago, Illinois and Winona, Minnesota.
[8] The Chicago, St. Paul, Minneapolis and Omaha Railway also became a presence in Elroy when its line was built from St. Paul, Minnesota, south through Camp Douglas, Wisconsin.
Rail traffic on the Elroy portion of the CNW eventually declined, due to the construction of better mainline trackage further to the north (via Adams, Necedah, and Wyeville).
The rails on this portion were taken up in the mid-1960s and the right-of-way was converted into the Elroy-Sparta Bike Trail, as it remains today.
[10] According to the United States Census Bureau, the city has a total area of 1.97 square miles (5.10 km2), all of it land.
There were 680 housing units at an average density of 343.4 per square mile (132.6/km2).
33.6% of all households were made up of individuals, and 13.4% had someone living alone who was 65 years of age or older.
32.0% of all households were made up of individuals, and 15.0% had someone living alone who was 65 years of age or older.