How to Convert GPS Coordinates — WGS84, GCJ02, BD09 Explained
Learn why your GPS pin shows the wrong location in China and how to fix it. Step-by-step guide to converting coordinates between WGS84, GCJ02, and BD09 — with examples for developers, GIS analysts, and map users.
How to Convert GPS Coordinates — WGS84, GCJ02, BD09 Explained
You record a GPS waypoint on your phone in Shanghai: 31.2304° N, 121.4737° E. You paste it into Baidu Maps. The pin lands in the middle of the Huangpu River — 500 meters from where you're standing. What happened?
You just mixed up two coordinate systems. Your phone recorded the location in WGS84 (the global GPS standard), but Baidu Maps expects BD09 (its proprietary offset system). The fix is simple: convert the coordinates before plotting them. This guide explains everything you need to know.
The Three Coordinate Systems
WGS84 — The Universal GPS Language
WGS84 (World Geodetic System 1984, EPSG:4326) is what GPS satellites broadcast. It's used by Google Maps everywhere except mainland China, Apple Maps globally, OpenStreetMap, and virtually every international mapping API. When your phone says "39.9042, 116.4074" at Tiananmen Square, that's WGS84 — geographically accurate with no intentional offset.
GCJ02 — China's Mandated Offset (Mars Coordinates)
GCJ02, nicknamed "Mars coordinates" by developers, is required by Chinese national standard GB/T 17278 for all maps published in mainland China. It applies a non-linear cryptographic offset that shifts coordinates by 100 to 500 meters — the direction and magnitude vary depending on your location. The algorithm is deliberately obfuscated to prevent reverse-engineering.
Platforms using GCJ02:
- AutoNavi (Gaode Maps) — China's largest navigation app
- Tencent Maps — integrated into WeChat
- Apple Maps — when viewed from mainland China
If you're building an app for the Chinese market, you must store coordinates in WGS84 and convert to GCJ02 only when displaying on a Chinese map.
BD09 — Baidu's Double Offset
BD09 takes GCJ02 and adds a second proprietary offset layer. This means a WGS84 coordinate first gets the GCJ02 shift (~100–500m), then an additional Baidu-specific shift — pushing the total offset up to ~700 meters from the true GPS position.
Baidu Maps is one of China's most-used platforms, and its LBSYUN developer SDK documents the BD09 specification. If your coordinates look wrong on Baidu, you're almost certainly feeding it WGS84 or GCJ02 data.
When You Need a Coordinate Converter
- You're a developer integrating a Chinese map API (AutoNavi, Tencent, Baidu) and need to normalize API responses to WGS84 for your database
- You're a GIS analyst preparing regulatory submissions for China — GCJ02 is mandatory per GB/T 17278
- You're debugging a map where pins appear offset by 100–700 meters
- You're using a GPS device in China that outputs WGS84 but need to display on a local map app
How to Convert — Step by Step
- Enter your coordinates — Type a latitude/longitude pair (e.g.
39.9042, 116.4074) or use the GPS button to auto-fill from your device - Select source system — Choose what your input uses: WGS84 for GPS/Google Maps, GCJ02 for AutoNavi/Tencent, BD09 for Baidu
- Select target system — Choose what you need the output in
- Click Convert — The result appears instantly. Outside mainland China, GCJ02 ≈ WGS84 — no offset is applied
Privacy: Your Coordinates Never Leave Your Device
Unlike server-side conversion tools that send your location data across the internet, this calculator runs entirely in your browser. Your coordinates are processed locally using open-source algorithms — no data is ever uploaded, stored, or shared with third parties.