Convert Shapefile (SHP) to GPX

This free converter turns a shapefile into a GPX 1.1 file for GPS devices and outdoor apps: points become waypoints, lines become tracks and polygons become a track along their outline. The shapefile is converted in your browser and is not uploaded. It is reprojected from the system in the .prj to WGS84, you choose which field becomes the name, and the other fields are kept as GPX extensions, which most devices ignore.

Did a file not convert correctly? E-mail [email protected], ideally with a small sample file, and it will be fixed.

Key facts

Shapefile to GPX: why convert

Trails, survey points, planned routes and field boundaries are often drawn or exported in QGIS or ArcGIS as shapefiles, but a Garmin handheld, a bike computer or apps such as OsmAnd, Locus Map, Gaia GPS and Komoot import GPX. This page writes a GPX file from your shapefile with GDAL, the open-source library behind QGIS, directly in your browser. It reads the .prj, so a shapefile in a UTM zone or a national grid comes out in the latitude and longitude every GPS uses, and it keeps heights from PointZ and PolylineZ shapefiles. You pick the attribute that devices should show as the name of each waypoint and track, and the map preview shows what will be written before you download it.

How to convert Shapefile to GPX

  1. Drop the .shp together with its .shx, .dbf and .prj, or a .zip with them, in the box.
  2. Check the map and pick the field to use for waypoint and track names.
  3. Click Convert to GPX and copy the file to your device or import it into your app.

What changes when you convert

Choose the name field

GPX has one name per waypoint or track, while a shapefile can have any number of fields. A field called NAME or name is used automatically; otherwise the page picks one whose name contains title or label, or the first text field, and says which. If you choose another field, the field called name is kept as name_orig. A field called DESC or DESCRIPTIO becomes the GPX description.

Points, lines and polygons

Point shapefiles become waypoints and line shapefiles become tracks. A line with several parts (a multipart polyline) becomes one track with several segments, and each point of a multipoint becomes its own waypoint. GPX has no areas, so a polygon becomes a closed track along its outline, with one segment for each ring. Several shapefiles chosen together are written to one GPX file.

The .prj decides where the data ends up

GPX always uses WGS84 latitude and longitude, so the shapefile is reprojected from the coordinate system in its .prj. Without a .prj, coordinates in meters cannot be placed; the page then stops and suggests systems that fit, or you enter the EPSG code, for example 25832 for UTM zone 32N.

Other fields go into extensions

Fields that have no GPX element of their own, such as LENGTH_KM or SURFACE, are written inside an extensions block. QGIS and GDAL read them back as fields, but GPS devices and most apps show only the name and description. Colors and symbols from a QGIS or ArcGIS project are not stored in the shapefile, so they cannot be carried over.

Heights and large files

The Z value of a PointZ or PolylineZ shapefile becomes the elevation of each point; a 2D shapefile, or one whose heights are all 0, gets none, so apps use their own elevation data. Older GPS devices accept only a limited number of points per track (often 10,000) or waypoints per file; simplify a long line in QGIS first if your device cuts it off.

About the formats

Shapefile

The Esri Shapefile is the most widely used GIS vector format. A single "shapefile" is really a set of files with the same name: .shp holds the geometry, .shx an index, .dbf the attribute table, and the optional .prj the coordinate system and .cpg the text encoding.

  • Needs at least .shp, .shx and .dbf. Select them together or as one .zip.
  • Field names are limited to 10 characters and text values to 254 characters.
  • Each shapefile holds one geometry type only: points, lines or polygons.
  • Without a .prj file the coordinate system is unknown.

GPX

GPX (GPS Exchange Format) is the XML format used by GPS devices and apps such as Garmin, Strava and Komoot. It stores waypoints, routes and tracks with optional time and elevation. Version 1.1 from 2004, published by TopoGrafix, is the one in use today.

  • Waypoints are single points; a route is a planned line through a few points; a track is the recorded path, often thousands of points.
  • Tracks can carry a time stamp and elevation for every point.
  • Coordinates are always WGS84 latitude and longitude.
  • GPX has a fixed set of fields (name, description, symbol, type and a few more); anything else must go into extensions.

Frequently asked questions

How do I get the GPX onto my Garmin?

Handhelds such as the eTrex or GPSMAP read GPX files copied into the Garmin/GPX folder over USB. For watches and bike computers, import the file as a course in Garmin Connect and send it to the device from there.

Should I make a track or a route?

Lines are written as tracks, which every device and app imports and shows as a line to follow. A GPX route is a short list of turning points that the device connects with its own routing, so a drawn trail is better kept as a track.

Can I import the GPX into Komoot or Strava?

Komoot imports GPX tracks as planned tours. Strava accepts a GPX as a route, but as an activity only when every point has a time, which a shapefile does not have.

Is my shapefile uploaded?

No. GDAL runs in your browser and the GPX is written on your own computer. Nothing is sent to a server.

Can I convert GPX back to a shapefile?

Yes, with the GPX to shapefile converter. Waypoints, routes and tracks become separate shapefiles there.