Merge & Combine GPX Files Online

Want to see your entire trip in one map? This GPX merger lets you combine separate GPS tracks and waypoints from multiple rides or hikes into one master file. Timestamps and elevation are copied unchanged, files can be sorted by start time, and you can put every segment into one track before uploading the file to Strava or Garmin Connect.

Want to test drive the tool?

Before & After

Combine fragmented tracks

Input: Two Morning Rides
xml
<!-- ride_part_1.gpx -->
<trk>
  <name>Morning Ride Pt 1</name>
  <trkseg>
    <trkpt lat="45.523" lon="-122.676"><ele>15.2</ele></trkpt>
    <trkpt lat="45.524" lon="-122.677"><ele>15.5</ele></trkpt>
  </trkseg>
</trk>

<!-- ride_part_2.gpx -->
<trk>
  <name>Morning Ride Pt 2</name>
  <trkseg>
    <trkpt lat="45.525" lon="-122.678"><ele>16.1</ele></trkpt>
  </trkseg>
</trk>
Output: Single Track (Merge all tracks into one)
xml
<trk>
  <name>Morning Ride (Merged)</name>
  <trkseg>
    <trkpt lat="45.523" lon="-122.676"><ele>15.2</ele></trkpt>
    <trkpt lat="45.524" lon="-122.677"><ele>15.5</ele></trkpt>
  </trkseg>
  <trkseg>
    <trkpt lat="45.525" lon="-122.678"><ele>16.1</ele></trkpt>
  </trkseg>
</trk>

How It Works

Clean and simple process

1

Upload GPX

Drag and drop GPX 1.0 or 1.1 files from common GPS apps and devices.

2

Choose Content

Include everything, or only tracks, only routes, or only waypoints.

3

Combine Data

Keep each track separate or put all segments into one track, in list order or sorted by start time.

4

Download File

Get a GPX 1.1 output file ready to review and import into your GPS app.

GPX Format Comparison

How GPX measures up

Comparison of popular GPS and geographic file formats
FeatureGPXKMLGeoJSONFIT
Primary UseGPS data exchangeMap visualizationWeb mappingFitness devices
Created ByTopoGrafixGoogleIETF / GeoJSON WGGarmin (ANT+)
FormatXMLXMLJSONBinary
Tracks / RoutesYesYes (LineString)Yes (LineString)Yes (Records)
WaypointsYesYes (Placemarks)Yes (Point)No
TimestampsPer track pointVia TimeStampNot built-inPer record
Fitness Data (HR, cadence)Via extensionsNoNoNative support
Human-ReadableYesYesYesNo (binary)
File SizeMediumMedium-LargeSmall-MediumVery small
Best ForHiking, cycling, GPS sharingGoogle Earth, visual mapsWeb apps, APIsGarmin watches, bike computers

Use Cases

GPS track consolidation

Multi-Day Hiking

Combine daily GPS logs from thru-hikes or backpacking trips into a single continuous track showing your entire journey on one map.

Broken Recording Fix

Stitch together tracks from a paused or restarted recording. Fix battery deaths mid-ride by merging the two halves back into one activity.

Waypoint Collection

Compile waypoints from multiple scouting sessions into a master POI file. Perfect for fishing spots, campsites, or geocache locations.

Race Route Planning

Merge separate route segments into a complete race course. Combine reconnaissance rides into one file for event organizers and participants.

Key Features

Built for performance

Smart Consolidator

Put every track segment into one track, in list order or sorted by start time.

Selective Merging

Merge everything, or only tracks, only routes, or only waypoints.

Data Preservation

Elevation, timestamps, routes, and waypoints are carried into the merged GPX where present.

FAQ

Common questions

Programmatic Merge

Python and CLI

Pythonmerge_gpx.py
import gpxpy
import glob

merged = gpxpy.gpx.GPX()

for filepath in sorted(glob.glob("day_*.gpx")):
    with open(filepath, "r") as f:
        gpx = gpxpy.parse(f)
        for track in gpx.tracks:
            merged.tracks.append(track)
        for waypoint in gpx.waypoints:
            merged.waypoints.append(waypoint)
        for route in gpx.routes:
            merged.routes.append(route)

with open("merged_trip.gpx", "w") as f:
    f.write(merged.to_xml())

print(f"Merged {len(merged.tracks)} tracks, "
      f"{len(merged.waypoints)} waypoints, "
      f"{len(merged.routes)} routes")
Bashmerge.sh
# Merge multiple GPX files using gpsbabel (CLI)
# Install: sudo apt install gpsbabel  (Linux)
#          brew install gpsbabel       (macOS)

# Merge two GPX files, keeping all tracks and waypoints
gpsbabel -i gpx -f day1.gpx -i gpx -f day2.gpx -o gpx -F merged.gpx

# Merge an entire folder of GPX files
gpsbabel \
  -i gpx -f morning_ride.gpx \
  -i gpx -f afternoon_ride.gpx \
  -i gpx -f evening_walk.gpx \
  -o gpx -F full_day.gpx

Complete Guide

In-depth walkthrough

What this tool is for

You recorded a route in two parts because your GPS died, your phone ran out of battery, or you split a long ride into segments. Now you want one complete file that shows the entire route from start to finish.

Drop both GPX files into the tool, put them in the right order, click merge, and download the combined version. Files are merged in the order shown in the list; drag them to reorder, or turn on Sort files by start time to order them by the first track point timestamp. Turn on Merge all tracks into one if you want a single track instead of one track per file. Then upload the file to Strava, Garmin Connect, Komoot, or wherever you track your activities. Track points, elevation, and timestamps are copied unchanged.

This is useful for multi-day hikes where you record each day separately, bike tours split across multiple rides, or any time your device dies mid-activity and you have to restart recording on a different device.

No technical knowledge needed. Everything happens in your browser, so your GPS data never gets uploaded to any server.

How to export your GPX file

From Strava: Open the activity you want to export, click the three-dot menu in the top right, select Export GPX, and the file downloads to your computer. You can only export your own activities, not other people's routes.

From Garmin Connect: Open the activity, click the gear icon in the top right, select Export to GPX, and the file downloads. If you recorded the activity on a Garmin watch or bike computer, this is the easiest way to get the GPX file.

From Komoot: Open the tour you want to export, click the three-dot menu, select Download, and choose GPX format. This works for both planned routes and completed tours.

From a Garmin device directly: Connect your Garmin watch or bike computer to your computer with a USB cable, open the device folder, go to the Garmin folder, then the Activities folder. Copy the .fit or .gpx files to your computer. If they're .fit files, export them from Garmin Connect first to convert to GPX.

After merging - where to upload it

To upload the merged file to Strava, go to the upload page, drag the GPX file in, and Strava creates one activity from the file. If an app shows only part of the route, merge again with Merge all tracks into one turned on. Same process for Garmin Connect and Komoot-just use their upload or import buttons.

The merged file carries the track points, timestamps, and elevation values from the source files. Apps such as Strava or Garmin Connect may recalculate distance, elevation gain, and moving time after import, so review the imported activity before relying on the final stats.

If you recorded the two parts on the same day, the merged activity will show the correct total time including any break between the two recordings.

Common reasons the merge might not work

Files from different devices may use different GPX versions (1.0 or 1.1). The tool accepts both and always writes GPX 1.1: waypoints, routes, and tracks from 1.0 files are moved into the 1.1 namespace, and extension data (such as heart rate) keeps its own namespace. Fields that only exist in GPX 1.0, such as <speed>, <course>, and <url>, are copied as-is; most apps ignore them, but a strict GPX 1.1 schema validator will flag them.

If you have .fit files from a Garmin device, you need to convert them to GPX first. The easiest way is to upload the .fit file to Garmin Connect, then export it as GPX from there. The tool only works with GPX files, not .fit files.

If your two tracks have a time gap between them (like you stopped for lunch and restarted recording an hour later), the merged file will show that gap. Strava and other apps will calculate your moving time correctly and exclude the break from your average pace or speed.

Related Articles