CSV to GPX Converter

A CSV to GPX converter turns a spreadsheet of coordinates into a file a Garmin, Strava, Komoot or any route planner will accept. This one writes waypoints, a timed track or a route, keeps elevation, normalises your timestamps to the RFC 3339 shape GPX requires, and sorts track points into time order. Everything happens in your browser.

Need to trim, sort or split the rows first? Open the app

Waypoints, tracks and routes are three different files

GPX can hold three kinds of thing, and the same list of coordinates can legitimately be any of them. Choosing wrong is the most common reason an import silently does nothing useful.

Waypoints are standalone saved places. A list of trailheads, mountain huts, photo spots or customer sites. In the file each one is a <wpt> element at the top level, with no relationship to the others. On a Garmin they appear as saved locations you can navigate to individually.

A track is a recording of somewhere you actually went: one continuous line, in time order, made of <trkpt> elements inside a <trkseg> inside a <trk>. This is what a watch produces and what Strava expects when you upload an activity. Points usually carry a timestamp, and that is what makes pace, duration and speed computable.

A route is a plan, not a recording: <rtept> elements in a <rte>, usually a handful of significant turns rather than thousands of samples. A device turns a route into turn-by-turn guidance. Feeding a device a 12,000-point track when it wanted a route is how you end up with navigation that recalculates every two seconds.

Because nothing in a CSV of latitudes and longitudes says which of the three you meant, this is a choice on the page rather than something guessed for you.

A worked example

A short recorded ride, exported from a database:

name,latitude,longitude,elevation,recorded_at
p1,51.5079,-0.0877,8.0,2024-11-03 07:02:11
p2,51.5071,-0.0962,7.4,2024-11-03 07:04:38
p3,51.5060,-0.1054,6.9,2024-11-03 07:07:02

Choose the track shape and you get:

<trk>
  <name>Converted track</name>
  <trkseg>
    <trkpt lat="51.5079" lon="-0.0877">
      <ele>8</ele>
      <time>2024-11-03T07:02:11.000Z</time>
      <name>p1</name>
    </trkpt>
    ...
  </trkseg>
</trk>

The recorded_at column was detected as the time column by name, and its 2024-11-03 07:02:11 became 2024-11-03T07:02:11.000Z. That transformation is the whole difference between a file Strava accepts and one it rejects.

Note also what is not there: no positional coordinate pair. GPX puts latitude and longitude in named attributes, which means the axis-order trap that catches people in GeoJSON, KML and WKT simply does not exist here. It is the one geo format where you cannot get the order wrong.

Timestamps are where GPX files fail

The GPX 1.1 schema types <time> as xsd:dateTime, and in practice that means RFC 3339 in UTC: 2024-11-03T07:02:11Z. The T is required. The Z is required unless you supply an explicit offset. A space instead of the T is not a lenient variant, it is a schema violation, and strict readers refuse the file rather than skipping the point.

Almost no CSV holds that shape. What CSVs hold is 2024-11-03 07:02:11 out of a database, or 1730617331 out of a log, or 03/11/2024 07:02 out of a spreadsheet. The first two are converted for you: a space between the date and time is replaced with the T and the value is marked UTC, and a bare ten-digit or thirteen-digit epoch is read as seconds or milliseconds respectively.

Anything that cannot be read as a date is left out of that point entirely, and the count is reported. A point with no <time> is valid GPX; a point with an invalid one can take the whole file down with it. Dropping it and saying so is the safer failure.

Ambiguous day-month-year formats are deliberately not guessed. 03/11/2024 is the third of November in London and the eleventh of March in New York, and a converter that picks one silently will eventually put your ride in the wrong month. Convert those to ISO in the app first, where you can say which order they are in.

Sorting, elevation, and the rows that get left out

Track points are sorted by time when a time column exists. This matters more than it sounds. A CSV that came out of a database without an ORDER BY is in whatever order the query planner felt like, and a track drawn through unsorted points is a scribble with speeds in the hundreds of kilometres per hour. The switch to keep file order is there for the case where your rows are already right and the timestamps are not.

Elevation comes through as <ele> when a column is detected or chosen. GPX measures it in metres above the WGS 84 ellipsoid. Nothing here can tell whether your numbers are feet, so a column of 500s stays 500 metres. If your source is in feet, convert before you come here.

Rows without a usable coordinate are counted and listed by line number with the offending value, the same way as on the other geo converters. If a track shape is chosen and no time column is found, that is called out too, because it is the difference between an activity Strava can score and a line it can only draw.

Questions

Should I make waypoints, a track or a route?

Waypoints are standalone saved places: trailheads, photo spots, a list of huts. A track is a recording of somewhere you went, one continuous line in time order, and it is the only shape Strava will accept as an activity. A route is a planned line that a device turns into turn-by-turn navigation. The same coordinates can be any of the three, which is why it is a choice rather than a guess.

Does GPX use latitude first or longitude first?

Neither, in the positional sense. GPX puts coordinates in named attributes, lat and lon, so there is no order to get wrong. That is unusual among geo formats: GeoJSON, KML and WKT are all positional and all longitude first. It is one less way for a GPX file to be quietly incorrect.

What format do the timestamps need to be in?

RFC 3339 in UTC, which looks like 2024-11-03T07:02:11Z. That is what the GPX schema requires and what strict readers enforce. Your CSV rarely holds that shape, so the common ones are converted for you: 2024-11-03 09:12:00 with a space, and a bare Unix epoch in seconds or milliseconds. Anything that cannot be read as a date is left out entirely rather than written as an invalid time element, because one malformed time is enough for some readers to reject the whole file.

Will Strava accept the file?

Strava imports a GPX as an activity when it contains a track with timestamps on the points. Choose the track shape and make sure a time column is detected; without times Strava can still draw the line but cannot compute duration, pace or speed. Waypoints alone are not an activity and will not import as one.

Is elevation included?

Yes, when there is a column for it. Elevation, ele, altitude, alt and a few variants are detected by name, or you can pick the column yourself. GPX expects metres above the WGS 84 ellipsoid. If your column is in feet, convert it first, because nothing here can tell the difference between 500 feet and 500 metres.

Are the track points sorted?

By time, when a time column exists, and that is on by default. A track whose points are out of order draws as a scribble and produces nonsense speeds, and a CSV that came out of a database with no ORDER BY is very often out of order. There is a switch to keep file order instead if your rows are already correct and the timestamps are not.

Is the file uploaded anywhere?

No. Everything happens in your browser tab, with no server round trip, no storage between visits and no row cap. GPS traces say where you live and when you leave the house, so a tool that never receives them is the right default.

Convert your CSV to GPX

No sign-up, no upload, no row cap. Waypoints, tracks or routes, with elevation and timestamps a device will accept.

Back to the converter