The Community of Madrid (Spanish: Comunidad de Madrid; [komuniˈðað ðe maˈðɾið] ) is one of the seventeen autonomous communities and 50 provinces of Spain. It is located at the heart of the Iberian Peninsula and Central Plateau (Meseta Central); its capital and largest municipality is Madrid. The Community of Madrid is bounded to the south and east by Castilla–La Mancha and to the north and west by Castile and León. It was formally created in 1983, in order to address the particular status of the city of Madrid as the capital of the Spanish State and in urban hierarchy. Its boundaries are coextensive with those of the province of Madrid, which was until then conventionally included in the historical region of New Castile (Castilla la Nueva).
The Community of Madrid is the third most populous in Spain with 7,058,041 (2024) inhabitants, roughly a seventh of the national total, mostly concentrated in the metropolitan area of Madrid. It is also the most densely populated autonomous community. Madrid has both the largest nominal GDP, slightly ahead of that of Catalonia, and the highest GDP per capita in the country. Madrid's economy is highly tertiarised, having a leading role in Spain's logistics and transportation.