Distrito vs. barrio

In Spanish, both 'distrito' and 'barrio' may be translated to English as 'district', but these two terms denote different geographical or administrative units within a city with distinguished peculiarities.

Distrito

A 'distrito' refers to an official administrative division within a city or municipality that is governed by a separate political entity or body. It's generally a larger area compared to a 'barrio'.
Madrid está dividido en veintiún distritos.
(Madrid is divided into twenty-one districts.)
Mi distrito se llama San Isidro.
(My district is called San Isidro.)
El distrito financiero de la ciudad es muy concurrido.
(The financial district of the city is very busy.)

Barrio

'Barrio' refers to a neighborhood inside the larger 'distrito'. It describes a community within the larger area of the city typically characterized by similarities such as socio-economic status, culture, or architectural style.
Vivo en el barrio de Salamanca, que forma parte del distrito de Salamanca en Madrid.
(I live in the Salamanca neighborhood, which is part of the Salamanca district in Madrid.)
El barrio gótico de Barcelona tiene una arquitectura impresionante.
(The Gothic quarter in Barcelona has impressive architecture.)
El Barrio Latino es un famoso barrio de París.
("Le Quartier Latin" is a famous neighborhood in Paris.)

Summary

'Distrito' and 'barrio' are two local administrative demarcations in Spanish language cities, with 'distrito' attending to a larger scale (like District of Columbia in the USA) and 'barrio' referring to smaller communities or neighborhoods within these districts (like Greenwich Village in New York City). It's important to note that use can vary between countries.