Skip to content
Distance between cities

Madrid to San Sebastián distance

Madrid and San Sebastián are 352 km (219 mi) apart in a straight line and 452 km (281 mi) apart by road: about 5 hr 5 min of driving without stops, mostly on the A-1 and the AP-1. Below you’ll find the route map, both halfway points, the bearing and where every figure comes from.

By the Mapsfera Team

Map from Madrid to San Sebastián: the straight line and the driving route
By road
452 km (281 mi)
Driving time
5 hr 5 min
Straight line
352 km (219 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 352 km (219 mi) geodesic on the WGS84 ellipsoid
By road 452 km (281 mi) fastest driving route (OSRM)
Driving time 5 hr 5 min no stops, no traffic
Road detour +28% 1.28 times the straight line
Average speed 88 km/h (55 mph) along the route, without stops
Bearing 23° (northeast) leaving Madrid toward San Sebastián
Midpoint 41.8736° N, 2.8582° W near Salduero (Soria)
Halfway by road In Cogollos (Burgos) 226 km from each city by road
Time difference None both share the same time
Elevation Madrid: 645 m (2,116 ft) · San Sebastián: 8 m (26 ft) IGN (Spain)
Population Madrid: 3,506,730 · San Sebastián: 189,866 INE population register, January 1, 2025

Madrid to San Sebastián by road

The fastest driving route is 452 km (281 mi) long and takes about 5 hr 5 min without stops or traffic. It runs mostly on the A-1 (258 km) and the AP-1 (169 km).

It goes through 3 autonomous communities: the Community of Madrid (97.1 km), Castile and León (231 km), and the Basque Country (124 km). That’s an average of 88 km/h (55 mph). Spain’s traffic authority (DGT) recommends a break every two hours or 200 km: with 2 stops of 20 minutes, the trip takes about 5 hr 45 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 San Sebastián are 352 km (219 mi) apart. That’s the geodesic on the WGS84 ellipsoid, the distance “as the crow flies”.

The road is 28% longer: for every 100 km in a straight line you drive 128. That’s a normal detour between two cities. Of the 40 Spanish pairs in this series, it ranks 13th for detour (the average is 24%).

From Madrid, San Sebastián lies to the northeast (bearing 23°), and from San Sebastián, Madrid lies to the southwest.

Halfway between Madrid and San Sebastián

Halfway along the straight line, 176 km (109 mi) from each city, is the point 41.8736° N, 2.8582° W. It falls near Salduero (Soria, pop. 148), 5.3 km away. The nearest town of 20,000 people or more is Soria (pop. 41,025), 35.0 km away.

By road, the halfway point is 226 km (140 mi) from each city, in Cogollos (Burgos, pop. 687). The nearest town of 20,000 people or more is Burgos (pop. 177,402), 14.9 km away. The two midpoints are 78.9 km apart: if you want to meet halfway, the one on the road is the useful one.

By plane

No flight time is given: under 500 km (311 miles) in a straight line, time at the airport outweighs time in the air.

The two cities

Madrid sits at 645 m (2,116 ft) and San Sebastián at 8 m (26 ft), 637 m (2,090 ft) lower.

Madrid has 3.5 million people and San Sebastián 189,866 people (INE population register, January 1, 2025).

Frequently asked questions

How many kilometers is it from Madrid to San Sebastián?

352 km (219 mi) in a straight line and 452 km (281 mi) by road on the fastest route (mostly on the A-1 and the AP-1).

How long is the drive from Madrid to San Sebastián?

About 5 hr 5 min without stops or traffic, according to OSRM with OpenStreetMap data; with 2 stops of 20 minutes, about 5 hr 45 min.

Where is the halfway point between Madrid and San Sebastián?

In a straight line, near Salduero (Soria). By road, 226 km from each city, in Cogollos (Burgos).

Which city is higher, Madrid or San Sebastián?

Madrid, at 645 m (2,116 ft); San Sebastián sits at 8 m (26 ft).

Which direction is San Sebastián from Madrid?

Northeast: the straight line leaves Madrid on a bearing of 23° (0° is north and 90° is east).

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 San Sebastián

Sources