drawamap

GPS coordinate converter

Paste anything that looks like a coordinate.

Degree signs, primes, smart quotes pasted out of a PDF, colons from a sexagesimal clock format, the odd stray word. It gets stripped and read.

Or click the map, and the box fills in for you.

Three formats, one angle

Every coordinate on this page is the same two angles underneath. All that changes is how the fraction gets written down, and that choice is historical rather than technical. Sixty minutes to a degree, sixty seconds to a minute: Babylonian arithmetic, still in use because clocks and charts both inherited it.

Decimal degrees is the one software wants. Signed, so a minus does the work of S or W. Sorts correctly, subtracts correctly, survives a trip through a spreadsheet.

Degrees-minutes-seconds is the one on paper and the one people say out loud. It’s also the one that quietly loses metres when someone prints it without decimals on the seconds.

Degrees and decimal minutes splits the difference and dominates at sea. Open the NMEA stream from any chartplotter and that’s what’s in it. Aviation too.

The Opera House, 33.8568°S 151.2153°E, written four ways:

One coordinate written four ways
FormatLatitudeLongitude
Decimal degrees-33.8568151.2153
DMS33°51'24.48"S151°12'55.08"E
Decimal minutes33°51.408'S151°12.918'E
UTM56H 334901E 6252289N
What the box will swallow

Real coordinates arrive filthy. Copied out of a PDF with curly quotes standing in for primes, or out of an email where the degree sign became a masculine ordinal, or out of a logger that writes colons. The parser throws away punctuation, keeps digits, signs and the four hemisphere letters, then works out where one angle ends and the next begins.

That last part is the tricky bit. 40 26 46 is one angle in three pieces. 40.44 -79.98 is two angles. The rule: degrees and minutes have to be whole when something follows them, so a decimal point ends the angle. A sign ends it. A hemisphere letter ends it. A comma ends it, unless honouring the comma would leave more than two angles, in which case it gets ignored and you can write 40, 26, 46 N after all.

Every row below was run through the parser when this page was rendered.

Accepted input formats and their results
You typeYou get
40°26'46"N 79°58'56"W40.4461, -79.9822
40 26 46 N, 79 58 56 W40.4461, -79.9822
40.4461, -79.982240.4461, -79.9822
N 40° 26.767', W 79° 58.933'40.4461, -79.9822
40:26:46N 79:58:56W40.4461, -79.9822
-33.8568 151.2153-33.8568, 151.2153
151.2153, -33.8568-33.8568, 151.2153 (swapped)
lat 51.5072 lon -0.127551.5072, -0.1275
A note on precision

Converting between these formats is exact. The same angle goes in and comes out; no projection, no datum, no approximation. What costs you is the printing, and it costs more than people expect. One second of latitude is about 30.8 m, so DMS rounded to whole seconds can only ever tell you which half of a tennis court you’re on.

Worst-case ground error for each rounding
Rounded toWorst case, north–southComment
DMS, whole seconds15.4 mThe usual way DMS is printed.
DMS, two decimals on the seconds15 cmWhat this page outputs.
Decimal minutes, three decimals92 cmThe NMEA default off a chartplotter.
Decimal minutes, whole minutes924 mFine at sea. Hopeless on land.
Decimal degrees, four places5.5 mThe most common way coordinates get published.
Decimal degrees, six places5.5 cmWhat this page outputs.

East-west error is the same or smaller, shrinking with the cosine of the latitude, so the figures above are the pessimistic ones. Worth knowing if you’re copying a DMS position off a document and wondering why it lands in the wrong garden. The document rounded, and 15.4 m of slop is about the width of a house.

Output here keeps two decimals on the seconds and three on the minutes, which puts the rounding well under the error of any GPS you own. Copy fewer digits if you like. Just don’t copy fewer and then treat the result as a survey mark.

FAQ
It won't read my coordinate. Why?
Most failures are one of three things. Minutes or seconds past 59, which means the number was already wrong before it got here. A pair where both halves claim the same axis, like two N's. Or stray text the parser can't classify, which it refuses rather than guesses at. If your string is reasonable and it still bounces, strip everything except digits, signs and the N/S/E/W letters.
Which one goes first, latitude or longitude?
Latitude, unless you tell it otherwise with hemisphere letters. Put an N, S, E or W on either half and the order stops mattering. There's one rescue built in: if the first number is past 90 it can't be a latitude, so the pair gets swapped and the panel says so. That catches GeoJSON-order coordinates that escaped from a file.
Do I lose anything converting back and forth?
Only what the rounding throws away, and that's the table above. Going decimal degrees to DMS at two decimals of seconds and back costs under 20 cm. Going to whole seconds and back can move you 15 m. The conversion itself is exact arithmetic on the same number; the loss is entirely in how many digits you keep.
Is this WGS84?
Yes, start to finish, which is what GPS gives you and what the map tiles are drawn in. Converting between formats never touches the datum. If your source is on OSGB36 or NAD27 the format conversion will be perfect and the position will still be wrong by anything up to a couple of hundred metres, because that's a datum shift and it needs a grid file.
Does anything get uploaded?
No. The parser and the formatters are a few hundred lines of JavaScript in the page. Map tiles come from OpenFreeMap; your coordinate never goes to them or to anyone else.

More map tools