Skip to content
Distance between cities

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

Map from Madrid to Barcelona: the straight line and the driving route
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
Straight line vs driving distance

Lambert azimuthal equal-area projection centered on the midpoint. Route: FOSSGIS OSRM with data © OpenStreetMap contributors, calculated on October 31, 2026; simplified line.

Missing a road? Fix it on OpenStreetMap

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.

More distances from Madrid

All distances

More distances from Barcelona

Sources