Building a GPS file converter that never uploads your files
Every online converter for fitness files works the same way: you upload your activity, a server parses it, you download the result. For a GPX track that is a strange deal to accept. The file is a precise log of where you live, where you train, when you leave the house, and how hard your heart was working the whole time. I built GPX Converter so that upload step does not exist. Everything runs in…
Building a GPS file converter that never uploads your files is a new approach to handling fitness data. Traditional online converters work by uploading your activity, which is then parsed on a server, and the result is downloaded. However, this process is problematic as it exposes your personal data to external servers. GPX Converter, a new tool, eliminates this issue by running everything entirely in the browser.
GPX Converter supports three main file formats: FIT, GPX, and TCX. FIT is Garmin's binary format, while GPX is plain XML and TCX resembles GPX but with lap and session structure. However, converting FIT to GPX enlarges the file size roughly 5-8 times, due to the shift from binary packing to human-readable XML.
All processing in GPX Converter occurs client-side, with no upload endpoint. The file never leaves the memory, and parsing runs in a dedicated Web Worker, ensuring the UI thread remains responsive. The output is then handed back as a Blob and downloaded straight from memory. The user can verify the process by opening devtools and using the network tab to drop a file, with no request carrying file bytes.
There's a catch: DOMParser does not exist in a Worker, which can cause issues. GPX and TCX are XML, so the obvious parser throws an error. However, FIT is unaffected as it is binary. Two fixes can handle this: parsing in the main thread or using a worker-safe XML parser. The chosen solution is Option A, parsing in the main thread, with structured data transfer across the wire.
Different formats have varying expressiveness. FIT supports position, elevation, heart rate, cadence, power, laps, and interval data. GPX handles position, elevation, and heart rate (through Garmin's TrackPointExtension), while TCX offers similar features to GPX but with limited lap and interval data. Therefore, a converter should disclose what it loses during conversion.
Repairing a corrupt FIT file can be done by rewriting the header's data-length field, re-computing the header CRC, and walking through the definition/record messages until the file is fully restored. This process can recover a substantial amount of data, as proven in a test on a 700 KB activity file.
The main advantage of local-first approach is that GPS data sensitivity and low server-side processing value make local processing sufficient. Using a browser as the runtime is a viable option, eliminating the need for server storage. The only downside is the inability to see user data, which is the primary concern for this category of tools. GPX Converter is available free of charge and without an account at gpxconverter.com.
Written by urgent.news from Dev.to's reporting — not their text. Machine-written — may contain errors; check the original before relying on it.