Distance between Barcelona and Madrid (straight line)
The straight-line distance between Barcelona and Madrid, both in Spain, is 504 km (313 miles), as the crow flies, measured from one city centre to the other. It is the shortest path over the Earth's surface; any road between them is longer.
Straight-line distance
504 km
313 miles · straight line
Heading from Barcelona
260° (west)
initial compass bearing to Madrid
Flight time estimate, not a booking
~40 min
at about 800 km/h, in the air only
Straight-line (great-circle) distance, as the crow flies. The road distance is longer.
BarcelonaMadridThe line is the great circle: straight over the globe, curved on a flat map.
Measure your own two places
Pick any two cities, addresses or coordinates in the calculator, or start from where you are standing. It gives the same straight-line distance, in miles and kilometres.
Barcelona to Madrid at a glance
- Straight-line distance
- 504 km (313 miles), as the crow flies
- Heading from Barcelona
- 260° (west) to Madrid
- Heading from Madrid
- 76° (east-northeast) to Barcelona
- Midpoint
- 40.9398° N, 0.7933° W, halfway along the straight line
- Flight time estimate, not a booking
- About 40 min in the air at a cruising speed of 800 km/h along the straight line. Take-off, landing, the real flight path and any stops add more.
- Barcelona, Spain
- 41.3888° N, 2.1590° E (city centre)
- Madrid, Spain
- 40.4165° N, 3.7026° W (city centre)
Nearby city pairs
Other distances from Barcelona
- Barcelona to Paris830 km
- Barcelona to Rome862 km
- Barcelona to Lisbon1,006 km
- Barcelona to London1,139 km
- Barcelona to Amsterdam1,239 km
- Barcelona to Berlin1,500 km
Other distances from Madrid
- Madrid to Lisbon503 km
- Madrid to Paris1,052 km
- Madrid to London1,264 km
- Madrid to Rome1,365 km
- Madrid to Amsterdam1,481 km
- Madrid to Berlin1,870 km
Questions
Is 504 km (313 miles) the driving distance from Barcelona to Madrid?
No. 504 km (313 miles) is the straight-line distance between the two city centres, as the crow flies. A road route is always longer, because roads bend around terrain and water, and MapGO does not measure driving distance or travel time.
How is the distance between Barcelona and Madrid measured?
Along a great circle: the shortest line over the Earth's surface, from Barcelona's centre (41.3888° N, 2.1590° E) to Madrid's (40.4165° N, 3.7026° W). This is what "straight-line distance" and "as the crow flies" mean on a globe. On a flat map the line can look curved.
How accurate is this distance?
Within about 0.5% for the two centre points. The figure treats the Earth as a sphere (the haversine formula), while the real Earth is slightly flattened, which shifts a long straight-line distance by up to about 0.5%. Measuring from another part of either city changes it more, since a large city can be tens of kilometres across.
Computed by MapGO from each city's centre point (GeoNames) with the haversine formula. All distances on this page are straight lines over the Earth's surface, not road distances.