How do I convert DMS to decimal degrees?
D + M/60 + S/3600 Decimal degrees = degrees + minutes/60 + seconds/3600, negative for S and W. Example: 39°54′33.2″N = 39 + 54/60 + 33.2/3600 = 39.909222°.
Free lat long converter: paste decimal, DMS or DDM in either order and get WGS84, UTM, Web Mercator plus China's GCJ-02 (AMap) and BD-09 (Baidu) at once. Iterative GCJ-02 inverse under 1 mm, batch CSV, runs in your browser.
One point per line as X (northing) then Y (easting), the order used in Chinese survey tables.
| WGS-84 / CGCS2000 GPS, iOS location, OpenStreetMap, Tianditu | 39.909230, 116.397428 39°54′33.23″N 116°23′50.74″E 39°54.5538′N 116°23.8457′E | |
|---|---|---|
| GCJ-02 AMap (Gaode), Tencent Maps, WeChat wx.getLocation gcj02 | 39.910634, 116.403672 | |
| BD-09 Baidu Maps (bd09ll) | 39.916973, 116.410044 | |
| Web Mercator (EPSG:3857) x, y in metres — web map tiles | 12957302.415, 4852760.584 | |
| UTM (WGS-84) zone + hemisphere, easting, northing in metres | 50N 448496.425 4417856.475 | |
| CGCS2000 3° Gauss-Krüger X (north), Y (east, zone prefixed) | X=4419624.325 Y=39448475.815 | |
| CGCS2000 6° Gauss-Krüger X (north), Y (east, zone prefixed) | X=4419624.325 Y=20448475.815 |
GCJ-02 moves this point 555 m from its WGS-84 position.
Inside the rectangle mainstream libraries use for “China” — it also covers the Korean peninsula, parts of Japan, Mongolia and Vietnam, where no offset should apply.
Each link carries the coordinates already converted into that map’s own system, so the pin lands in the right place.
| Line | Input | Output |
|---|
Written and reviewed by the developers who build the site's geo and encoding tools. Every coordinate, distance and error figure on this page is computed by the tool's engine or comes from the measurements below, and is checked by tests.
D + M/60 + S/3600 Decimal degrees = degrees + minutes/60 + seconds/3600, negative for S and W. Example: 39°54′33.2″N = 39 + 54/60 + 33.2/3600 = 39.909222°.
GCJ-02 / BD-09 / WGS-84 AMap (Gaode), Tencent Maps and WeChat gcj02 use GCJ-02; Baidu Maps uses BD-09, a second offset on top of GCJ-02; GPS, iOS location and OpenStreetMap use WGS-84. None of the three Chinese map APIs offers a conversion back to WGS-84.
17.6–715 m It varies with location: 17.6–715 m across China on a 0.05° grid, median about 430 m. Around Tiananmen it is about 555 m, in Guangzhou about 621 m. BD-09 adds another 0.76–0.98 km.
It depends on the source Google Maps and the official EPSG:4326 axis order put latitude first; GeoJSON and the AMap and Baidu APIs put longitude first (116.403672,39.910634). A swapped pair moves a point thousands of kilometres, so the tool detects the order and tells you why.
≈ 0.11 m At the equator one degree is about 111.3 km, so 5 decimals ≈ 1.1 m, 6 decimals ≈ 0.11 m and 7 decimals ≈ 1.1 cm. One arc-second of latitude is about 30.8 m.
These six formulas match the tool's engine; every example value was computed by it. Formulas 5 and 6 are the complete GCJ-02 forward transform: two polynomials give the offset, which is then converted to degrees with the arc lengths at that latitude — the same coefficients as gcoord and coordtransform.
DD = D + M/60 + S/3600
S/W: DD = -(D + M/60 + S/3600)
39°54′33.2″N →
= 39.9092222°
T = round(|DD| × 3600 × 10^k); D = ⌊T / (3600·10^k)⌋
M = ⌊(T − D·3600·10^k) / (60·10^k)⌋; S = remainder / 10^k
116.397428°, k = 2 →
= 116°23′50.74″
z = √(x² + y²) + 0.00002·sin(y·π·3000/180); θ = atan2(y, x) + 0.000003·cos(x·π·3000/180)
lng_bd = z·cos θ + 0.0065; lat_bd = z·sin θ + 0.006
GCJ-02 (116.403672, 39.910634) →
= BD-09 (116.410044, 39.916973)
x = R·λ; y = R·ln(tan(π/4 + φ/2)), R = 6378137
|φ| ≤ 85.0511287798066°
(116.397428°, 39.90923°) →
= (12957302.415, 4852760.584)
T_lat = −100 + 2x + 3y + 0.2y² + 0.1xy + 0.2√|x| + ⅔(20·sin 6πx + 20·sin 2πx) + ⅔(20·sin πy + 40·sin(πy/3)) + ⅔(160·sin(πy/12) + 320·sin(πy/30))
T_lng = 300 + x + 2y + 0.1x² + 0.1xy + 0.1√|x| + ⅔(20·sin 6πx + 20·sin 2πx) + ⅔(20·sin πx + 40·sin(πx/3)) + ⅔(150·sin(πx/12) + 300·sin(πx/30))
(116.397428, 39.90923) → x = 11.397428, y = 4.90923 →
= T_lat = 155.8381, T_lng = 533.8815
Δφ = T_lat·180 / (a(1 − e²)/W³·π); Δλ = T_lng·180 / (a/W·cos φ·π)
a = 6378245, e² = 0.00669342162296594323, W = √(1 − e²·sin²φ)
WGS-84 (116.397428, 39.90923) →
= GCJ-02 (116.403672, 39.910634)
WGS-84 is the global datum behind GPS. Coordinates from GPS receivers, iOS Core Location (documented as the WGS 84 reference frame) and OpenStreetMap are WGS-84. China's CGCS2000 uses an ellipsoid that differs from WGS-84 only in the ninth significant digit of the flattening, so for development work the two can be treated as the same.
GCJ-02, nicknamed "Mars coordinates", is the system Chinese map services use: AMap's and Tencent's official docs both state they use the GCJ-02 system specified by China's surveying authority. It adds a non-linear, location-dependent offset to WGS-84 — measured at 17.6–715 m across China. That is why a GPS point drawn straight onto AMap lands a few hundred metres off.
BD-09 is Baidu Maps' system, a further offset applied on top of GCJ-02 (Baidu's docs: "encrypted again on the basis of GCJ02"). It comes as bd09ll (degrees) and bd09mc (metres); this tool handles bd09ll. Note that bd09mc is not Web Mercator EPSG:3857 — the northing differs by 17–30 km for the same point.
This tool uses the published open-source formulas: its GCJ-02 and BD-09 forward results match gcoord and coordtransform, and its inverses iterate until the round trip is below a millimetre. The formulas were reverse-engineered, and there is no public benchmark against the official algorithm, so the results suit development and data processing — not survey deliverables.
WGS-84 39.909230, 116.397428 (GPS / iOS / OSM) GCJ-02 39.910634, 116.403672 (AMap / Tencent) +555 m BD-09 39.916973, 116.410044 (Baidu) +1378 m AMap / Baidu API order: lng,lat → 116.403672,39.910634
Decimal, DMS, DDM, d m s letters, Chinese 北纬/东经 with 度分秒, hemisphere letters before or after, and Google Maps @lat,lng links are all read as they are — no cleanup first.
AMap/Baidu lng,lat and Google lat,lng are told apart and the reason is shown under the box. For western-China points where both values are below 90, GCJ-02/BD-09 input is read longitude-first by the China-range rule.
One point, seven answers: WGS-84, GCJ-02, BD-09, Web Mercator, UTM, and CGCS2000 3° and 6° Gauss-Krüger zones, each with its own Copy button — no switching conversion directions back and forth.
GCJ-02→WGS-84 and BD-09→GCJ-02 use a fixed-point iteration instead of the common one-step shortcut, which is off by about 0.36 m in Beijing, 2.07 m in Shanghai and up to about 4.9 m on a grid covering China. After 3–5 iterations the round trip is below 1 mm, asserted by unit tests.
UTM zones include the Norway and Svalbard exceptions and are written with N/S for the hemisphere. Gauss-Krüger uses the CGCS2000 ellipsoid with X north and Y east (zone-prefixed). Checked against PROJ to within 1 mm.
Paste up to 5,000 lines and get a result or a reason for each one. Pick the target system and angle format, then copy or download CSV (UTF-8 with BOM). Nothing leaves your browser.
Supports WGS84/GCJ02/BD09/BD09MC/EPSG:3857. Its GCJ-02 inverse stops when the residual is below 1e-6°, which measured up to 0.147 m of error; the BD-09 inverse is a single step. This tool's forward results match it; its inverses are tighter.
The most copied implementation. gcj02towgs84 is the one-step inverse (about 2.07 m off around Shanghai, up to about 4.9 m on the grid), and its China box (73.66–135.05°E, 3.86–53.55°N) leaves out China's own extreme points such as far-north Mohe.
The reference implementation for UTM, Gauss-Krüger and EPSG systems — this tool's projections agree with it to within 1 mm. PROJ has no GCJ-02 or BD-09, so Chinese map coordinates still need separate handling.
/v3/assistant/coordinate/convert turns GPS or Baidu coordinates into AMap coordinates, but offers no conversion back to GPS, needs an API key and sends your coordinates to a server.
Converts GPS, AMap/Tencent, bd09ll and bd09mc into Baidu coordinates. Its docs state that, according to legal provisions, no coordinate type can be converted to GPS.
DMS to decimal is a one-liner (=D+M/60+S/3600), but GCJ-02, BD-09 and Gauss-Krüger formulas are long and easy to get wrong. For bulk data, paste here and export CSV.
Input system: GCJ-02 116.403672,39.910634
WGS-84: 39.909230, 116.397428 BD-09: 39.916973, 116.410044
AMap's API returns longitude first; the tool reads it that way because 116 is above 90. The inverse is iterated — the common one-step shortcut is off by 0.074 m here, about 2.07 m around Shanghai, and up to about 4.9 m (in the north-east corner) on a grid covering China.
Input system: WGS-84 39°54′33.2″N 116°23′50.7″E
WGS-84: 39.909222, 116.397417
39 + 54/60 + 33.2/3600 = 39.909222 and 116 + 23/60 + 50.7/3600 = 116.397417. The Chinese form 北纬39度54分33.2秒,东经116度23分50.7秒 gives the same result.
Input system: WGS-84 31.2304, 121.4737
3°: X=3457455.489 Y=40640412.315 6°: X=3457523.539 Y=21354575.479
Shanghai at 121.47°E falls in 3° zone 40 (central meridian 120°E) and 6° zone 21 (central meridian 123°E). Different central meridians give different X and Y; the first two digits of Y are the zone.
39.90923, 116.397428 31.239692, 121.499755 22.543096, 114.057865
39.910634, 116.403672 31.237678, 121.504188 22.540379, 114.062979
Pasting several lines opens the batch table; set Convert to GCJ-02 for the result above. To feed the AMap API, switch Output order to lng, lat before exporting the CSV.
Choose by where the coordinates came from: GPS receivers, iOS location and OSM are WGS-84; AMap, Tencent Maps and WeChat mini-programs with type: 'gcj02' are GCJ-02; Baidu Maps is BD-09. Projected coordinates (Web Mercator metres, UTM, CGCS2000 Gauss-Krüger) work as input too.
Decimal, DMS, DDM, N/S/E/W letters before or after, and Chinese 北纬/东经 notation are all read; commas, spaces or semicolons separate the values. Gauss-Krüger input follows the Chinese survey order X (northing) then Y (easting); a Y with a zone prefix such as 39448475.815 sets the zone automatically.
The line under the box says whether the values were read as latitude, longitude or longitude, latitude, and why (hemisphere letters, a value above 90, or the China-range rule). When both values are below 90 the order cannot be proven, so latitude-first is assumed — change Value order if needed.
Every row has a Copy button, and Output order can switch to lng, lat for AMap or Baidu APIs. Multi-line input builds a batch table; choose the target system and angle format, then copy or download the CSV (UTF-8 with BOM, so Excel opens it cleanly).
AMap and Baidu APIs put longitude first; Google Maps and most spreadsheets put latitude first. Reading lng,lat as lat,lng moves a point thousands of kilometres.
lat=116.403672, lng=39.910634
lat=39.910634, lng=116.403672
GPS receivers and iOS location return WGS-84. Plotted directly on AMap the pin is a few hundred metres off, and further off on Baidu. Convert to the map's own system first.
AMap marker ← 39.909230, 116.397428 (WGS-84)
AMap marker ← 39.910634, 116.403672 (GCJ-02)
BD-09 sits another 0.76–0.98 km away from GCJ-02. A point picked on Baidu Maps must be converted with BD-09 as the input system, not used as GCJ-02.
GCJ-02 ← 39.916973, 116.410044 (from Baidu)
BD-09 → GCJ-02: 39.910634, 116.403672
EPSG:4326 is degrees; EPSG:3857 is metres. Feeding 116.39 and 39.90 into EPSG:3857 puts the point a few hundred metres from 0°N 0°E, in the Gulf of Guinea.
EPSG:3857 x=116.397428, y=39.90923
EPSG:3857 x=12957302.415, y=4852760.584
Splitting into degrees, minutes and seconds first and rounding the seconds afterwards produces invalid values like 39°59′60.00″. Round to the last shown digit first, then split.
39°59′60.00″
40°00′00.00″
A Y without the zone prefix (such as 448475.815) cannot tell you the central meridian. Enter the zone-prefixed Y, or fill in the zone number.
X=4419624.325 Y=448475.815 (zone ?)
X=4419624.325 Y=39448475.815 (3° zone 39)
wgs ≈ 2·gcj − f(gcj) has a median error of 0.42 m and a maximum of about 4.9 m on a grid covering China (73.5–135°E, 18–53.5°N, 35,321 points), found in the north-east corner near 131°E, 53.25°N. This tool iterates w ← g − Δ(w) until the step is below 1e-10° (at most 10 times); it converges in 3–5 steps with a round trip under 1 mm. BD-09→GCJ-02 iterates the same way.lng_gcj02 or lat_wgs84, and state in the API docs whether it is lng,lat or lat,lng. Most "the pin is off" bugs in production are an unstated system or order.π where the mainstream formula uses x_pi, which puts them up to 90 m apart — check which library the other side used. wx.getLocation({ type: 'gcj02' }). 59′60″. In batch mode, set Angle format to DMS. Conversion Tools
Convert between binary, hex, decimal, octal and any base (2-36) instantly. Free, private — all processing in your browser.
Conversion Tools
Type a signed integer and get sign-magnitude, ones' complement, two's complement and offset binary at once, at 4 to 64 bits. Or paste a bit pattern or hex byte and see all five readings side by side. Local, free, no sign-up.
Conversion Tools
Convert Linux file permissions between octal (755, 644) and rwx symbols. Get chmod commands, spot risky settings like 777 — free, right in your browser.
Conversion Tools
Convert HEX to RGB, HSL, OKLCH, OKLAB and CMYK in your browser — copy any format with one click. Free, no signup, your colors never leave the page.
Conversion Tools
Convert HEX colors to CMYK in your browser. Naive sRGB-based approximation for print previews. Free, no signup, your colors stay local.
Conversion Tools
Convert any hex color to HSL in your browser — 3-digit, 6-digit, 8-digit alpha all supported. Free, instant, no signup, your colors never leave the page.