Wirt is a town in Allegany County, New York, United States. The population was 1,059 at the 2020 census. The town is in the southwest part of the county and east of Olean. The area that would become the town was first settled circa 1812. The town of Wirt was created in 1838 from parts of the towns of Bolivar and Friendship.