Westby was founded in 1910 as a town in what was then Williams County, North Dakota. Danish settlers came up with the name by combining the wordwest, which noted the town's location in extreme western North Dakota, with the word by, Danish for town. The town remained in North Dakota until 1914, when it was moved slightly across the border so as to be next to a newly built branch line of the Soo Line Railroad and in a state that permitted the sale of alcohol.
As of the census of 2010, there were 168 people, 82 households, and 49 families residing in the town. The population density was. There were 114 housing units at an average density of. The racial makeup of the town was 95.8% White, 2.4% Native American, and 1.8% from two or more races. Hispanic or Latino of any race were 1.8% of the population. There were 82 households of which 19.5% had children under the age of 18 living with them, 53.7% were married couplesliving together, 3.7% had a female householder with no husband present, 2.4% had a male householder with no wife present, and 40.2% were non-families. 36.6% of all households were made up of individuals and 12.2% had someone living alone who was 65 years of age or older. The average household size was 2.05 and the average family size was 2.67. The median age in the town was 48.3 years. 19% of residents were under the age of 18; 4.3% were between the ages of 18 and 24; 19.1% were from 25 to 44; 35.1% were from 45 to 64; and 22.6% were 65 years of age or older. The gender makeup of the town was 52.4% male and 47.6% female.
2000 census
As of the census of 2000, there were 172 people, 88 households, and 52 families residing in the town. The population density was 317.2 people per square mile. There were 121 housing units at an average density of 223.1 per square mile. The racial makeup of the town was 98.26% White, 1.16% Native American, and 0.58% from two or more races. Hispanic or Latino of any race were 1.74% of the population. There were 88 households out of which 14.8% had children under the age of 18 living with them, 51.1% were married couples living together, 5.7% had a female householder with no husband present, and 39.8% were non-families. 35.2% of all households were made up of individuals and 23.9% had someone living alone who was 65 years of age or older. The average household size was 1.95 and the average family size was 2.47. In the town, the population was spread out with 15.1% under the age of 18, 2.9% from 18 to 24, 22.7% from 25 to 44, 34.3% from 45 to 64, and 25.0% who were 65 years of age or older. The median age was 50 years. For every 100 females there were 109.8 males. For every 100 females age 18 and over, there were 105.6 males. The median income for a household in the town was $32,875, and the median income for a family was $44,583. Males had a median income of $35,625 versus $18,125 for females. The per capita income for the town was $19,438. About 4.7% of families and 9.4% of the population were below the poverty line, including none of those under the age of eighteen and 20.0% of those sixty five or over.