Madrid to Barcelona distance
Madrid and Barcelona are 506 km (314 mi) apart in a straight line and 617 km (383 mi) apart by road: about 6 hr 50 min of driving without stops, mostly on the A-2 and the AP-2. Below you’ll find the route map, both halfway points, the bearing, the approximate flight time and where every figure comes from.
By the Mapsfera Team
- By road
- 617 km (383 mi)
- Driving time
- 6 hr 50 min
- Straight line
- 506 km (314 mi)
- Driving route
- Straight line
- Straight-line midpoint
- Halfway by road
Lambert azimuthal equal-area projection centered on the midpoint. Route: FOSSGIS OSRM with data © OpenStreetMap contributors, calculated on October 31, 2026; simplified line.
The figures
| Figure | Value |
|---|---|
| Straight line | 506 km (314 mi) geodesic on the WGS84 ellipsoid |
| By road | 617 km (383 mi) fastest driving route (OSRM) |
| Driving time | 6 hr 50 min no stops, no traffic |
| Road detour | +22% 1.22 times the straight line |
| Average speed | 90 km/h (56 mph) along the route, without stops |
| Bearing | 76° (east) leaving Madrid toward Barcelona |
| Midpoint | 40.9380° N, 0.7786° W near Josa (Teruel) |
| Halfway by road | Near Zaragoza 309 km from each city by road |
| Time difference | None both share the same time |
| Approximate flight | 1 hr 10 min estimate: 30 min + the straight line at 800 km/h |
| Elevation | Madrid: 645 m (2,116 ft) · Barcelona: 13 m (43 ft) IGN (Spain) |
| Population | Madrid: 3,506,730 · Barcelona: 1,731,649 INE population register, January 1, 2025 |
Madrid to Barcelona by road
The fastest driving route is 617 km (383 mi) long and takes about 6 hr 50 min without stops or traffic. It runs mostly on the A-2 (317 km), the AP-2 (216 km), and the AP-7 (48.6 km).
It goes through 5 autonomous communities: the Community of Madrid (40.4 km), Castilla–La Mancha (99.4 km), Castile and León (39.8 km), Aragon (253 km), and Catalonia (185 km). That’s an average of 90 km/h (56 mph). Spain’s traffic authority (DGT) recommends a break every two hours or 200 km: with 3 stops of 20 minutes, the trip takes about 7 hr 50 min. The time is OSRM’s estimate with OpenStreetMap data: no traffic and speeds somewhat below the limits, so real trips can differ.
Straight-line distance and bearing
In a straight line, the shortest distance over the Earth’s surface, Madrid and Barcelona are 506 km (314 mi) apart. That’s the geodesic on the WGS84 ellipsoid, the distance “as the crow flies”.
The road is 22% longer: for every 100 km in a straight line you drive 122. That’s a normal detour between two cities. Of the 40 Spanish pairs in this series, it ranks 19th for detour (the average is 24%).
From Madrid, Barcelona lies to the east (bearing 76°), and from Barcelona, Madrid lies to the west. The straight line reaches Barcelona on a bearing of 80°: on a sphere the bearing keeps changing along the way, which is why the shortest route looks slightly curved on a flat map.
Halfway between Madrid and Barcelona
Halfway along the straight line, 253 km (157 mi) from each city, is the point 40.9380° N, 0.7786° W. It falls near Josa (Teruel, pop. 34), 2.2 km away. The nearest town of 20,000 people or more is Teruel (pop. 36,655), 71.7 km away.
By road, the halfway point is 309 km (192 mi) from each city, near Zaragoza (pop. 693,091), 4.6 km away. The two midpoints are 83.1 km apart: if you want to meet halfway, the one on the road is the useful one.
By plane
A direct flight would take about 1 hr 10 min. That’s an estimate: 30 minutes for takeoff, climb, descent and landing, plus the 506 km straight line at 800 km/h (about 497 mph), a typical airliner cruising speed. Real schedules depend on wind, routing and airports, and not every pair has a direct flight.
The two cities
Madrid sits at 645 m (2,116 ft) and Barcelona at 13 m (43 ft), 632 m (2,073 ft) lower.
Madrid has 3.5 million people and Barcelona 1.7 million people (INE population register, January 1, 2025).
Frequently asked questions
How many kilometers is it from Madrid to Barcelona?
506 km (314 mi) in a straight line and 617 km (383 mi) by road on the fastest route (mostly on the A-2 and the AP-2).
How long is the drive from Madrid to Barcelona?
About 6 hr 50 min without stops or traffic, according to OSRM with OpenStreetMap data; with 3 stops of 20 minutes, about 7 hr 50 min.
Where is the halfway point between Madrid and Barcelona?
In a straight line, near Josa (Teruel). By road, 309 km from each city, near Zaragoza.
How long is the flight from Madrid to Barcelona?
About 1 hr 10 min, estimated from the straight-line distance (506 km): 30 minutes for takeoff and landing plus the trip at 800 km/h. Real flight times vary with wind and routing.
Which city is higher, Madrid or Barcelona?
Madrid, at 645 m (2,116 ft); Barcelona sits at 13 m (43 ft).
Measure it yourself on the map
The same two cities, already set up in the tools: move the points, get the route by bike or on foot and download the map.
- Distance between two points Measure the distance between any two places or points on the map, in miles or kilometers.
- Straight line vs driving distance Compare the as-the-crow-flies distance with the real driving distance and see how much the road adds.
- Halfway point Find the exact halfway point between two places and see it on the map, ready to share.
More distances from Madrid
All distances- Madrid to Valencia 302 km straight line · 355 km by road · 3 hr 55 min
- Madrid to Seville 391 km straight line · 534 km by road · 5 hr 55 min
- Madrid to Zaragoza 274 km straight line · 315 km by road · 3 hr 30 min
- Madrid to Málaga 415 km straight line · 535 km by road · 6 hr 5 min
- Madrid to Bilbao 322 km straight line · 397 km by road · 4 hr 25 min
- Madrid to Alicante 360 km straight line · 420 km by road · 4 hr 35 min
More distances from Barcelona
- Barcelona to Valencia 303 km straight line · 351 km by road · 4 hr 5 min
- Barcelona to Zaragoza 257 km straight line · 311 km by road · 3 hr 30 min
- Barcelona to Bilbao 469 km straight line · 610 km by road · 6 hr 40 min
- Barcelona to Girona 85.8 km straight line · 103 km by road · 1 hr 20 min
- Barcelona to Tarragona 82.8 km straight line · 96.8 km by road · 1 hr 20 min
- Barcelona to Seville 831 km straight line · 997 km by road · 11 hr 5 min
Sources
- Driving route: FOSSGIS OSRM, car profile (calculated on October 31, 2026) · FOSSGIS e.V.
- Roads, streets and places · © OpenStreetMap contributors (ODbL)
- Straight line, bearings and midpoint (geodesics on the WGS84 ellipsoid) · GeographicLib (C. F. F. Karney)
- Location and elevation of Spanish cities (gazetteer and DEM) · Instituto Geográfico Nacional (CC BY 4.0)
- Population register, January 1, 2025 · INE (Spain)
- Places near the midpoints: Mapsfera gazetteer (GeoNames, INE, IGN and Census) · Mapsfera
- Time zones (timezone-boundary-builder outlines and the IANA database) · © OpenStreetMap contributors (ODbL)
- Map: provinces (IGN), states (US Census Bureau) and countries (Natural Earth) · IGN, Census and Natural Earth
- Methodology