Obernai is a rapidly growing city, its number of inhabitants having gone up from 6,304 in 1968 to 11,099 in 2006. The metropolitan area of Obernai had 12,369 inhabitants in 2006, from 7,293 in 1968.
The Obernai region, which was the property of the dukes of Alsace in the 7th century, is the birthplace of St. Odile, daughter of the Duke, who would become the Patron Saint of Alsace.
The Obernai name first appears in 1240, when the village acquires the status of town under the tutelage of the Hohenstaufen family. The town then prospers. It becomes a member of the Decapole in 1354, an alliance of ten towns of the Holy Roman Empire in Alsace. Obernai's status reaches its apex in the 15th and 16th century.
The Thirty Years War (1618-1648) damages the town, which is occupied by the Imperial troups then by the Swedes. The town is ransomed and ceded to France in 1679, and starts to recover some of its prosperity, without totally recapturing its former glory.
The town is annexed by Germany in 1871 with the rest of Alsace then is returned to France after World War I in 1918.