Williamsburg was the capital of the British colony of Virginia from 1699. The town was first called "Middle Plantation", but was renamed Williamsburg in honor of King William III of England. The College of William and Mary was established in the town in 1693. The town was granted a royal charter as a city in 1722.
In 1780, during the American Revolutionary War, the capital was moved to Richmond at the urging of then-Governor Thomas Jefferson, who was afraid that Williamsburg's location made it vulnerable to a British attack.
During the American Civil War, the Battle of Williamsburg was fought nearby on May 5, 1862, during the Peninsula Campaign.
In the early 20th century, John D. Rockefeller financed a project to restore a large portion of the city's 18th century buildings to their original condition. The restored area is known as Colonial Williamsburg.
According to the United States Census Bureau, the city has a total area of 22.5 km² (8.7 mi²). 22.1 km² (8.5 mi²) of it is land and 0.3 km² (0.1 mi²) of it is water. The total area is 1.50% water.
As of the census of 2000, there are 11,998 people, 3,619 households, and 1,787 families residing in the city. The population density is 542.4/km² (1,404.1/mi²). There are 3,880 housing units at an average density of 175.4/km² (454.1/mi²). The racial makeup of the city is 79.54% White, 13.34% African American, 0.27% Native American, 4.58% Asian, 0.06% Pacific Islander, 0.75% from other races, and 1.47% from two or more races. 2.52% of the population are Hispanic or Latino of any race.
There are 3,619 households out of which 16.5% have children under the age of 18 living with them, 37.2% are married couples living together, 9.6% have a female householder with no husband present, and 50.6% are non-families. 35.9% of all households are made up of individuals and 11.4% have someone living alone who is 65 years of age or older. The average household size is 2.07 and the average family size is 2.66.
The age distribution, which is heavily influenced by the College of William and Mary, is: 9.6% under the age of 18, 46.0% from 18 to 24, 17.7% from 25 to 44, 15.0% from 45 to 64, and 11.7% who are 65 years of age or older. The median age is 23 years. For every 100 females there are 81.3 males. For every 100 females age 18 and over, there are 80.8 males.
The median income for a household in the city is $37,093, and the median income for a family is $52,358. Males have a median income of $28,625 versus $26,840 for females. The per capita income for the city is $18,483. 18.3% of the population and 9.3% of families are below the poverty line. Out of the total people living in poverty, 29.7% are under the age of 18 and 5.5% are 65 or older.
Williamsburg is served by two airports: Newport News/Williamsburg International Airport, in nearby Newport News; and Norfolk International Airport, located on the other side of Hampton Roads in Norfolk.