Corsham is a historic market town and civil parish in west Wiltshire, England. It is at the south-western edge of the Cotswolds, just off the A4 national route, 28 miles (45 km) southwest of Swindon, 20 miles (32 km) east of Bristol, 8 miles (13 km) northeast of Bath and 4 miles (6 km) southwest of Chippenham.
 Historically, Corsham was a centre for agriculture and later, the wool industry, and remains a focus for quarrying Bath Stone. It has several notable historic buildings; among them the stately home of Corsham Court. During the Second World War and the Cold War it became a major administrative and manufacturing centre for the Ministry of Defence, with numerous establishments both above ground and in disused quarry tunnels.
 The parish includes the villages of Gastard and Neston, which is at the gates of the Neston Park estate.
 Corsham appears to derive its name from Cosa's hām, "ham" being Old English for homestead, or village. The town is referred in the Domesday book as Cosseham; the letter 'R' appears to have entered the name later under Norman influence (possibly caused by the recording of local pronunciation), when the town is reported to have been in the possession of the Earl of Cornwall. Corsham is recorded as Coseham in 1001, as Cosseha in 1086, and as Cosham as late as 1611 (on John Speed's map of Wiltshire). The Corsham area belonged to the King in Saxon times, the area at the time also had a large forest which was cleared to make way for further expansion.
 There is evidence that the town had been known as "Corsham Regis" due to its reputed association with Anglo-Saxon Ethelred of Wessex, and this name remains as that of a primary school.
 One of the towns that prospered greatly from Wiltshire's wool trade in medieval times, it maintained its prosperity after the decline of that trade through the quarrying of Bath stone, with underground mining works extending to the south and west of Corsham. The main turnpike road (now the A4) from London to Bristol passed through the town.
 Numbers 94 to 112 of the High Street are Grade II* listed buildings known as the "Flemish Weavers Houses", however there is little cogent evidence to support this name and it appears more likely to derive from a handful of Dutch workers who arrived in the 17th century. The Grove, opposite the High Street, is a typical example of classic Georgian architecture, as is The Ivy in Priory Street. There are more than 60 listed buildings in the High Street.
 Corsham's small town centre includes the historic High Street and the Martingate Centre, a late 20th-century retail development.
 The stately home of Corsham Court can also be found in the town centre. Standing on a former Saxon Royal Manor, it is based on an Elizabethan manor home from 1582. Since 1745, it has been part of the Methuen estate. The house has an extensive collection of Old Masters, rooms furnished by Robert Adam and Thomas Chippendale, and parks landscaped by Capability Brown and Humphry Repton. The house is open to the public all year round excluding December and is famed locally for its peacocks, which wander about the streets. The owner of Corsham Court in the mid-seventeenth century was the commander of the Parliamentarian New Model Army in Wiltshire; his wife built what came to be known as the Hungerford Almshouses in the centre of town.
 The Pound is an arts venue and community hub for north Wiltshire, run by the Pound Arts Trust and supported by Arts Council England, Wiltshire Council, South Gloucestershire Council and Corsham Town Council. Their Rural Touring Scheme take performances to villages in Wiltshire and South Gloucestershire.
 Pound Arts also organises two annual festivals: the Blue Sky Festival in June, for various art forms including music and comedy; and the Magic and Mayhem Festival in November, featuring magic, burlesque, music hall and other decadent arts.
 The village of Gastard was a settlement by the 12th century. It has a 20th-century church.
 Neston village was established around Neston Park, a country estate whose house was built c.1790. Neston Park is home of the Fuller family, who give their name to the Fuller, Smith and Turner brewery in London, known for Fuller's London Pride cask ale.
 Pickwick was once a separate settlement and now forms the north-western part of the town. The name derives from Anglo-Saxon pic (meaning a peak or pointed hill) and wic (village). The Wiltshire Hundred Roll of 1273 refers to a "William de Pikewicke".
 Corsham was the inspiration for Charles Dickens' novel The Pickwick Papers; it is thought that he borrowed the name from Moses Pickwick, a coachman who was born in Pickwick, lived in the "Hare and Hounds" inn, and ran coaches between Bath and London.
 North of the A4, besides Pickwick, are the hamlets of Middlewick, Upper Pickwick and Cross Keys.
 Settlements now within Corsham's built-up area are Hudswell, Leafield, Westwells with Moor Green and Neston further south. In the east of the parish are Easton, Thingley and Westrop, and in the southeast Chapel Knapp, Gastard, Monk's Park, The Linleys and The Ridge.
 Pickwick Manor, on the Bath Road, was noted by architectural historian Nikolaus Pevsner as an "unusually impressive example of a late 17th century manor house", having remnants of a 14th-century wing. More recently, the Grade II* listed house has been the residence of architect Harold Brakspear and his descendants.
 Beechfield is a late Georgian house in Middlewick Lane, just north of the town. It was extended in the early 1970s to provide additional accommodation. The house was split into residential accommodation while part of the grounds were split off in 2002 under the auspices of the Town Council to provide a nature area where local flora and fauna can be seen. Nearby, Guyers House is a 17th-century house, now a hotel and restaurant.
 Middlewick House, just outside the town, was occupied by Camilla Parker Bowles (later Queen Camilla) and her first husband between 1986 and 1995, when it was bought by Nick Mason of Pink Floyd. Further to the north, Hartham Park is a Georgian estate that includes a rare stické court. Rudloe Manor, a 17th-century Grade II* listed manor house, is off the Bath Road west of the town, just outside Corsham parish.
 When the Local Government Act 1972 came into force on 1 January 1974, Corsham came within the areas of Wiltshire County Council and North Wiltshire District Council, electing one county councillor and three district councillors from the Corsham and Lacock division. On 1 April 2009, Wiltshire became a unitary authority managed by Wiltshire Council and the county's district councils were all merged into this body. From 2009, voters in the area elect three councillors to the new authority, one from each of three new single-member electoral divisions:
 Corsham's first tier of government is Corsham Town Council, which was founded as a parish council in 1895. Although Corsham never had its own town charter, in May 2000 it became a town council. There are currently twenty councillors, and the four council committees are:
 The first official census of 1801 showed Corsham having 2,402 inhabitants, while that of 2011 recorded exactly 13,000. The increase shown for 1840 is due to the influx of stone workers and the arrival of the Great Western Railway. No census was taken in 1941 due to the Second World War, but the jump in population (from 3,754 in 1931 to 9,268 in 1951, an increase of 147%) is attributable to the influx of military personnel.
 The 2001 census demographics of the SN13 postcode area, of which Corsham comprises the major part, did not differ markedly from national figures; the unemployment rate was 2.0 per cent compared to a national 3.2 per cent, and there was a marginally higher rate of retirees (at 23.3 per cent as against 22 per cent). 23 per cent of adults are educated to degree level, against a national average of 20 per cent.
 Corsham has four primary schools, an independent preparatory school and a large secondary school. The primary schools, catering for students up to age 11, are:
 Two schools outside the parish take pupils from Corsham: Box CE (VC) Primary School and Shaw CE Primary School.
 The Corsham School, The Tynings, is Corsham's only secondary school; it was opened in 1972 as a comprehensive school and is now a large academy with a sixth form. In 2022 the school had 1,176 pupils.
 Heywood Prep School, Priory Street, is an independent school providing education from ages 2 to 11, and has about 180 pupils. It achieved a favourable assessment when last inspected in May 2014, being described as "a welcoming, friendly and open community. As a result of feeling safe and well looked after, pupils thrive and challenge themselves to reach their full potential.". It is located on two acres of property in the centre of Corsham, near Corsham Court, on a site first mentioned in the Domesday Book as a priory donated to an order of monks. The Grade II Georgian building in Bath stone is from 1776; later additions include a barn, used as a dining room and later a science block, and a multi-functional performance hall. The school is part of the Wishford Schools group. The school was rated 17th in The Sunday Times Top 100 Prep Schools in November 2014.
 Corsham Priory was referred to in 1336 as having been given to Marmoutier Abbey during the time of Henry I (1068–1135) as an alien priory. An unnamed prior was referred to in 1201, but the priory had become inactive by 1294 and its lands passed to The Crown and eventually to King's College, Cambridge. Later a Georgian house was built on the site, which is now part of Heywood Prep School.
 The town of Corsham and surrounding villages are within the jurisdiction of the Diocese of Bristol. The churches are served by the Corsham & Lacock Churches team ministry, which extends east to St Cyriac's, Lacock and St Anne's, Bowden Hill.
 The main parish Church of St Bartholomew, which stands between the High Street and Corsham Court, is partly built on Saxon foundations. The present church has 12th-century origins but underwent major Victorian restoration in 1875-8 by G.E. Street.
 Pevsner writes: "A large church with a commanding S tower with spire. It looks as if it were all built for the great house and the estate in the days of Victorian prosperity. In fact Street only restored an old church, but he did it unfortunately thoroughly, and he added the tower."
 Street's tower replaced an earlier central tower. Around the same time the chancel was restored by C.F. Hansom, who also added a north chapel for the Methuen family. The north aisle remains from the early 14th century, and the south aisle from later in that century; the nave has Norman arcades and a 15th-century roof. In 1960 the church was designated as Grade I listed.
 In the north chancel chapel, the large altar tomb of 15th-century landowner Thomas Tropenell is shared with his first wife, Agnes.
 The Church of St Philip and St James at Neston was opened in 1866. Its architecture is early English, in local stone to designs of J.H. Hakewill. Internal re-ordering was completed in 1985.
 The Church of St. John the Baptist at Gastard was built in 1912 in the gothic style.
 St. Patrick's Roman Catholic Church was opened in 1945, replacing temporary centres which had been arranged for the wartime population influx.
The building is the former Pickwick school, opened in 1858 on land gifted in 1846 by Lord Methuen and his tenants, Sir Gabriel Goldney and Arthur Knapp; the architect was Henry Goodridge of Bath. The school closed in 1922 and the building was used for a time as a glove factory, then as a gas mask factory.
 Monk's Chapel, built near Gastard in 1662, was formerly a Quaker meeting-house and was transferred to the Congregational church in 1690. The chapel is a Grade I listed building and continues in use as of 2016.
 The Baptist Chapel, Moor Green, was founded in 1833. Ebenezer Baptist Chapel, Velly, was founded in 1857.
 The Congregational Church, Pickwick Road, originally met in a malthouse, and a new building was commenced in 1790. In 1971 it closed and is now used as offices.
 Ebenezer Chapel, Priory Street, was formed in 1822/3 when some members of the Congregational Church split over doctrine. The present building opened in 1829 and has been extended since then. As of 2016, the building is still in use, as Corsham Baptist Church. Zion Hill Baptist Chapel was built in 1859 by a group who separated from the Priory Street chapel.
 The Particular Baptist Chapel, Pound Pill, dates back to about 1824. The Brethren met in several locations, beginning in the mid nineteenth century at Pockeridge Lodge, moving to Neston, while another group met in Pickwick. By 1903, both were meeting in Neston and in 1925 they bought the Primitive Methodist Chapel, Station Road.
 A large Wesleyan Methodist chapel was built on Pickwick Road in 1903. In 1984 the congregation was joined by the nearby Congregational church (which by then was part of the United Reformed Church) to form the United Church of St Aldhelm. In 2016 the church continues in use.
 Corsham is connected to Bradford on Avon by the B3109 road, to Melksham by the B3353, and to Chippenham and Bath by the A4 Bath Road, a former turnpike from London to Bristol. Junction 17 of the M4 motorway is about 8 miles (12 km) from Corsham. Bus company Faresaver operate local services, as well as buses to nearby towns (including the twice-per-hour X31 between Bath and Chippenham).
 The Great Western Main Line railway from London to Bristol, Exeter and Penzance passes through the town, though Corsham station closed in 1965. Proposals to reopen the station have been put forward since at least 2009, and in 2021 a feasibility study was approved by the Department for Transport.
 Nearby stations, and most passenger trains, are operated by Great Western Railway. Some local services call at the nearest station at Melksham (4.5 miles, 7.2 km) while Chippenham station (4.7 miles, 7.5 km) offers frequent express services and connections.
 The eastern portal of Box Tunnel, the longest railway tunnel of its time, built by Isambard Kingdom Brunel for the Great Western Railway, is at Hudswell on the western edge of the town. Corsham Railway Cutting carries the main line westward through Corsham to Box Tunnel; in 1971, 6.6 hectares (16 acres) of land in the cutting were designated a Site of Special Scientific Interest for notable geology.
 Corsham has had a twinning relationship with the town of Jargeau, France since 1981, and has an active twinning association. Corsham holds an annual twinning event in which musical and charity events occur, accompanied by French food and wines. There is also a boules competition for the Peter Henderson trophy which is named in memory of a local doctor and former chairman of the twinning association. As part of the 2008 event, a mock Storming of the Bastille was staged to celebrate Bastille Day, Corsham Town Hall standing in for the Parisian prison.
 The Ministry of Defence has operated a number of locations in the vicinity of Corsham since the First World War and employs approximately 2,000 people. Several defence sites in the Corsham area are located underground and were formed from historic Bath Stone quarries. The largest of the above-ground sites are centred around the Hawthorn area of Corsham.
 The Basil Hill site is in Westwells Road and comprises the former Basil Hill Barracks; the site is now designated MOD Corsham and accommodates approximately 2,100 people. It is home to UK Strategic Command's Defence Digital organisation and also houses the Ministry of Defence's Global Operations Security Control Centre, amongst other units.
 The Rudloe site, bordering Westwells Road and Bradford Road, was one of three sites that comprised RAF Rudloe Manor. Rudloe Manor was established during the Second World War as a non-flying station for administrative and command & control purposes. It was home to HQ Number 10 Fighter Group, RAF Regional Command, Headquarters RAF Police & Security Services, No 1 Signals Unit, Controller Defence Communications Network and 1001 Signals Unit. The main site also served as the primary entrance for the Central Government War Headquarters, variously known as "Turnstile", "Stockwell", "Subterfuge" and "Burlington".
 By 1998 it had become mostly administrative, housing the RAF Provost and Security Services, which dealt with security and criminal investigation. The sites were taken over by the Defence Communication Services Agency in about 2000, while the detachment of 1001 Signals Unit of the RAF remained at the Hawthorn site until its privatisation. RAF Rudloe Manor was then absorbed into Joint Support Unit Corsham.
 Hawthorn site, on Skynet Drive, previously accommodated the RAF 1001 Signal Unit detachment of RAF Rudloe Manor. The site supports the Skynet military communications satellite constellations, which is now managed by Astrium Services under a PFI arrangement.
 The Copenacre site, off the A4 Bath Road about 1 mile (1.6 km) west of Corsham, was originally an underground stone quarry below land formerly part of the Hartham estate; this was taken over by the Ministry of Defence in 1937 and became the Royal Naval Stores Depot, Copenacre. The underground stores closed on 30 September 1995. The site closed completely in January 2011 and was sold. In 2016 demolition started to redevelop the brownfield site into housing. Two original mine structures remain incorporated into the development, one being a shaft entrance.[citation needed]
 The Joint Support Unit provides administrative support and facilities management for all three locations. In 2006 a Private Finance Initiative contract was let to Inteq for the renewal and expansion of the Basil Hill and Rudloe Site facilities, valued at around £800m.
 Corsham Computer Centre is a Royal Navy data processing facility.
 The Services Cotswold Centre in Neston is a welfare centre offering temporary accommodation for services families who require it. The centre has 63 family units, a medical centre and other amenities.
 HMS Royal Arthur was a training establishment between 1947 and 1993.
 A number of defence-related contractors are co-located or in the vicinity of the MoD sites, such as Chemring Energetics UK Limited and Serco Defence, Science and Technology.[citation needed]
 Underground extraction of Bath Stone continues in Corsham on a smaller scale than previously. Hanson plc operates Hartham Park Quarry in the Hudswell district, south-west of Pickwick, and Monk's Park Quarry near Gastard.
 Disused quarries have been redeployed for other purposes; apart from defence usage, there is a wine storage facility at Eastlays, near Gastard run by Octavian Vaults, and storage of magnetic media for off-site data protection at Neston.
 Another use for the quarries is the film industry.  Underground scenes from the first episode of Blake's 7 were filmed at Eastlays, and disused tunnels form part of the studio complex of Corsham Media Park, a specialist business park that opened in 2001 adjacent to RAF Rudloe Manor.
 Period drama location filming occurs in Corsham, as in neighbouring Lacock and Atworth parishes.  Neston Park hosted major outdoor film sets for the 2008 BBC television adaption of Lark Rise to Candleford, and the BBC also filmed scenes for a 2008 version of Tess of the D'Urbervilles in Church Street and Corsham Court grounds.
 Corsham Court has also been used as a period location in productions such as Barry Lyndon (1975), The Remains of the Day (1993), A Respectable Trade (1997) and Wives and Daughters (1999).
 In 2014, scenes for the new adaptation of Poldark were filmed in the town's High Street, meaning Corsham then featured in every series until the drama ended in 2019.
 Local news and television programmes are provided by BBC West and ITV West Country. Television signals is received from the Mendip and the local relay transmitters. 
 Local radio stations are BBC Radio Wiltshire on 104.3 FM, Heart West on 102.2 FM, Greatest Hits Radio South West on 107.5 FM, and Kik Radio, a community radio station that broadcast online. 
 The local newspapers are the Gazette and Herald and Wiltshire Times. 
 Corsham has a non-League football club Corsham Town F.C., founded in 1884, who play at Southbank. They finished first in the Western Football League Premier Division in 2007.
 Neighbouring civil parishes (anticlockwise from the north):
 Nearby sites of Special Scientific Interest (SSSIs):