How far am I from the Spanish border?

Spain shares land borders with Morocco, France, Portugal, Gibraltar and Andorra. Use your location to measure the straight-line distance from where you are to the nearest point of Spain, or see below how far major cities on both sides of the border are.

How far are you from Spain?

On a phone this uses GPS. The calculator opens with Spain already selected and measures from your exact spot.

Spain's neighbours

Spain is shown in green, and the 5 countries it shares a land border with in blue.

  • Spain
  • Land neighbours

Which countries border Spain? See every neighbour and the countries two borders away

How far major cities are from Spain

CityCountryTo Spain
GibraltarGibraltar1.1 km (0.7 miles)
Andorra la VellaAndorra4.4 km (2.7 miles)
les EscaldesAndorra5.5 km (3.4 miles)
PortoPortugal83 km (52 miles)
LisbonPortugal161 km (100 miles)
MarseilleFrance200 km (125 miles)
RabatMorocco247 km (153 miles)
CasablancaMorocco322 km (200 miles)
ParisFrance678 km (421 miles)

How far Spain's cities are from its borders

CityNearest neighbourTo that border
BarcelonaFrance107 km (67 miles)
ZaragozaFrance128 km (79 miles)
MadridPortugal245 km (152 miles)
ValenciaFrance358 km (222 miles)

Straight-line distance from each city centre to the nearest point of the other country, measured October 8, 2026.

Questions

How far am I from the Spanish border?

Tap "Use my location" on this page. On a phone it uses GPS, and the calculator measures the straight-line distance from where you are to the nearest point of Spain, in miles and kilometers.

Which countries border Spain?

Spain shares land borders with Morocco, France, Portugal, Gibraltar and Andorra.

Is this the distance to a border crossing?

No. It is the straight-line distance to the nearest point on the border line itself. The nearest official crossing can be much farther away by road.

Does it measure across water?

Yes. It measures to the nearest point of Spain's territory. From most places that is the land border, but from somewhere across a sea or a lake it can be Spain's coast.

Which big city is closest to Spain?

Of the cities measured here, Gibraltar in Gibraltar is the closest: 1.1 km (0.7 miles) from Spain in a straight line.

Other borders