Obergerlafingen is a municipality in the district of Wasseramt in the canton of Solothurn in Switzerland. Obergerlafingen is first mentioned in 1278 as Oburgeroluingen. Obergerlafingen has an area, , of . Of this area, or 48.0% is used for agricultural purposes, while or 19.7% is forested. Of the rest of the land, or 32.2% is settled (buildings or roads). Of the built up area, industrial buildings made up 3.3% of the total area while housing and buildings made up 21.1% and transportation infrastructure made up 5.9%. while parks, green belts and sports fields made up 2.0%. Out of the forested land, all of the forested land area is covered with heavy forests. Of the agricultural land, 35.5% is used for growing crops and 10.5% is pastures, while 2.0% is used for orchards or vine crops. The municipality is located in the Wasseramt district, between the Emme and Oesch rivers. It consists of the linear village of Obergerlafingen. The blazon of the municipal coat of arms is Gules three Mullets Argent in pale. Obergerlafingen has a population () of . , 7.3% of the population are resident foreign nationals. Over the last 10 years (1999–2009 ) the population has changed at a rate of -1.4%. It has changed at a rate of 2.7% due to migration and at a rate of -1.8% due to births and deaths. Most of the population () speaks German (1,017 or 97.1%), with Italian being second most common (13 or 1.2%) and French being third (8 or 0.8%). the gender distribution of the population was 50.1% male and 49.9% female. The population was made up of 495 Swiss men (45.4% of the population) and 51 (4.7%) non-Swiss men. There were 510 Swiss women (46.8%) and 34 (3.1%) non-Swiss women. Of the population in the municipality 278 or about 26.6% were born in Obergerlafingen and lived there in 2000. There were 347 or 33.1% who were born in the same canton, while 311 or 29.7% were born somewhere else in Switzerland, and 71 or 6.8% were born outside of Switzerland. In there were 5 live births to Swiss citizens and were 12 deaths of Swiss citizens.