Mechanicsville is an unincorporated community and census-designated place (CDP) in Hanover County, Virginia, United States. The population was 39,482 during the 2020 census, up from 36,348 in the 2010 census.
 The area was settled by English colonists starting in the 17th century. Rural Plains, also known as Shelton House, is a structure built in 1670 and lived in by male Sheltons until 2006. Located in the northern part of the Mechanicsville CDP, it is now owned and operated by the National Park Service as one of the sites of the Richmond National Battlefield Park.
 In addition to Rural Plains, Clover Lea, Cold Harbor National Cemetery, Cool Well, Hanover Meeting House, Hanover Town, Immanuel Episcopal Church, Laurel Meadow, Locust Hill, Oak Forest, Oakley Hill, Selwyn, and Spring Green are listed on the National Register of Historic Places.
 In downtown Mechanicsville stands a stone windmill, now a landmark in the area. The building was constructed as a Heritage Bank branch office in the 1970s. In 2007–2008, it was restored and enlarged by a new bank occupancy. The "windmill" is decorative and driven by an electric motor.
 Mechanicsville, and the surrounding area, was the site of numerous battles during the American Civil War. The first was the Battle of Beaver Dam Creek, which began on June 26, 1862. Confederate General A.P. Hill launched a series of assaults against Union Major General Fitz John Porter's army positioned along Beaver Dam Creek, just east of Mechanicsville. Union forces repulsed the Confederate attacks and afterward withdrew to a new position along Boatswain Creek near Gaines' Mill. The Beaver Dam Creek engagement was the second in the series of Civil War battles known as the Seven Days Battles. A small portion of the battlefield in the southeast part of the CDP has been preserved as part of the Richmond National Battlefield Park, a park area administered by the National Park Service.
 The Battle of Gaines' Mill was the third of the Seven Days Battles, occurring farther east of Mechanicsville. A portion of the battlefield has been preserved at the "Watt House" as part of the Richmond National Battlefield Park, a park area administered by the National Park Service.
 Near Gaines' Mill was the Battle of Cold Harbor, the final battle of Union Lieut. Gen. Ulysses S. Grant's 1864 Overland Campaign. This was fought over the same ground as the Battle of Gaines' Mill. The area identified as part of the battlefield for "Second Cold Harbor" stretches from near the intersection of Walnut Grove Road and Mechanicsville Turnpike to "Turkey Hill" near the Rt. 156 crossing of the Chickahominy River. An area of the battlefield which saw heavy casualties and a nearby post-war National cemetery are preserved as historic monuments.
 Mechanicsville comprises the western portion of Hanover County's southern extension, north of the Chickahominy River. The southern border of the CDP, which follows the Chickahominy, is the Henrico County line, and at its closest point, Mechanicsville is less than two miles from the city limits of Richmond. U.S. Route 360 passes through the CDP, leading southwest 6 miles (10 km) to the center of Richmond and northeast 40 miles (64 km) to Tappahannock. Interstate 295, an eastern bypass of Richmond, crosses Mechanicsville from northwest to southeast, with access from exits 41, 38, 37, and 34. U.S. Route 301 forms the northwest border of the CDP, leading south 9 miles (14 km) to the center of Richmond and north 29 miles (47 km) to Bowling Green.
 The original rural hamlet of Mechanicsville is in the southwest part of the CDP along US 360, just southwest of I-295 Exit 37. The CDP also includes the neighborhoods or named places of Pearsons Corner, Oak Forest, Kings Charter, Rural Point, Borkeys Store, Burnside Farms, Mayfield Farms, Carneals Store, Pole Green, Newman, Dogwood Knoll, Spring Meadows, Brandy Creek Estates, Windy Hill Estates, Ellerson Mill, and Simpkins Corner.
 According to the U.S. Census Bureau, the Mechanicsville CDP has a total area of 28.4 square miles (73.6 km2), of which 28.3 square miles (73.3 km2) are land and 0.1 square miles (0.3 km2), or 0.42%, are water. The southern part of the CDP is drained by the Chickahominy River and its tributaries, flowing to the James River, while the northern part is drained by tributaries of the Pamunkey River, part of the York River watershed.
 As of the census of 2020, there were 39,482 people and 14,675 households residing in the CDP. The population density was 1,393.4 people per square mile (414.5/km2).
 The racial makeup of the CDP was 84.0% White, 8.9% African American, 0.2% Native American, 1.6% Asian, 0.1% Pacific Islander, and 4.7% from two or more races. Hispanic or Latino of any race were 1.8% of the population.
 In the CDP the population was spread out, with 22.7% under the age of 18, 5.7% from 18 to 24, 33.6% from 25 to 44, 22.5% from 45 to 64, and 11.2% who were 65 years of age or older. The median age was 36 years.
 The median income for a household in the town was $84,833. The per capita income for the CDP was $38,487. 5.5% of the population were below the poverty line.