# Maidenhead geocode system

The Maidenhead Locator System encodes a pair of longitude and latitude coordinates in a slightly complicated but ingenious way. Amateur radio operators using this geocoding system to describe locations.

The Wikipedia article on the subject describes the what of the system, but I’d like to say more about the why of the system. I’ll also go through an example in great detail.

## High-level description

The Maidenhead system interleaves longitude and latitude information. Starting from the left end, the odd-numbered positions contain longitude data and the even-numbered positions contain latitude data. The first two characters are capital letter from A through R, and together they specify a field. The second two characters are digits specifying a square. The next two characters are lower case letters from a through x specifying a subsquare. These terms will be explained below.

## Running example

As a running example, we’ll find the Maidenhead coordinates of the geographic center of the United States,

44° 58′ 2.07622″ N, 103° 46′ 17.60283″ W.

This is a point somewhere in South Dakota. If your first thought is that the center is in Kansas, that is the center of the contiguous United States, but the point in South Dakota is the geographic center when you include Alaska and Hawaii.

## Fields

The first character in a Maidenhead locator string is a letter from A through R. These 18 letters divide longitude into 18 parts, so each letter represents 20 degrees longitude. The second character is also a letter from A to R dividing latitude into 18 parts, so each letter represents 10 degrees latitude.

Before we go any further, let’s think about the reasoning that might have gone into what we’ve described so far. You could use the entire alphabet and divide longitude or latitude into 26 parts, but it’s much easier to work with 18 parts so that the number of degrees represented by a letter is a multiple of 10.

By alternating longitude and latitude information, you maximize the information contained in the initial part of the string. If two locations start out with the same two letters, i.e. the points are located in the same field, you know they’re located with 1,539 miles or 2,476 kilometers of each other. If we gave all the longitude information first, and that’s all the information you had, then two points that start out the same could be as far a part as half the earth’s circumference, about 12,500 miles or 20,000 kilometers.

### Zero longitude

Longitude is measured in degrees east of the opposite of the Prime Meridian. That is, the Prime Meridian has longitude 180°. Why not just use the Prime Meridian as your starting point?

The opposite of the Prime Meridian is basically the International Date Line, except that the latter zigzags a bit to avoid splitting island groups. So the zero point for Maidenhead longitude runs through a very sparsely populated part of the globe; coordinate wrap-around happens out in the ocean rather than in the middle of England.

Also, with the Maidenhead system, local time increases with alphabetical order. This would not be the case if we’d used longitude east of the Prime Meridian. In the latter system, the time would be later in B than in A, but time in Z would be earlier than time in A.

### Zero latitude

Latitude is measure in terms of degrees north of the South Pole. Using the South Pole rather than the equator as the zero location eliminates the need for signed latitude.

### Example

Our example point is

103° 46′ 17.60283″

west of the Prime Meridian, so it’s

76° 13′ 42.39717″

east of our zero longitude line. Zero to 20 degrees encodes as A, 20 to 40 degrees as B, etc. and so the longitude of our point encodes as D.

Our point is

44° 58′ 2.07622″

north of the equator, and so it’s

134° 58′ 2.07622″

north of the South Pole. That puts it in the 14th band, the band from 130° to 140°, and the 14th letter is N.

So our example point is located in field `DN`.

## Square

A field is 20 degrees wide and 10 degrees high. A square is divided into 100 parts by breaking the longitude into increments of 2 degrees and the latitude into increments of 1 degree. Squares are indicated by digits.

### Example

As we said above, our example point is has longitude

76° 13′ 42.39717″

east of our starting point. It’s in a field that starts at 60°, so it’s a little more than 16 degrees east of the western edge of the field. That puts it in one of the squares that run from 16° to 18° east of the edge of the field. This is encoded as 8.

Our example point is

134° 58′ 2.07622″

north of the South Pole. It’s in a field that starts at 130°, so it’s over 4° north of the southern edge of the field. This is encoded as 4.

So our Maidenhead location so far is `DN84`.

## Subsquare

A subsquare divides a square into 576 (24 × 24) parts. A square is 2 degrees wide and 1 degree tall, so a subsquare is 1/24 of that in each direction, which amounts to 5 minutes wide and 2.5 minutes tall. Subsquares are denoted by letters a through y.

### Example

Our example point is a little more than 13 minutes east of the western edge of its square, which puts it in the 3rd group of 5 minute increments, so the longitude is encoded as c.

Our example point is 58′ 2.07622″ north of the bottom of its square. This puts it in the last group of 2.5 minute increments, which is encoded as x.

So the complete encoding of our sample point is `DN84cx`. The longitude information is in `D`, `8`, and `c`, and the latitude information is in `N`, `4`, and `x`.

### Example going the other direction

Now let’s say we started with the encoding `DN84cx`. Where is this?

`D` tells us the longitude is between 60 and 80 degrees east of the International Date Line. The `8` tells us to add 8 increments of 2 degrees, so that puts us somewhere between 76 and 78 degrees east. The `c` tells us to add between 10 and 15 minutes. So our longitude is between 76° 10′ and 76° 15′ east of the opposite of the Prime Meridian, or between 103° 45′ and 103° 50′ west of the Prime Meridian.

`N` tell us we’re between 130 and 140 degrees north of the South Pole, or between 40 and 50 degrees north of the equator. The `4` tells us to add 4 degrees, so we’re between 44 and 45 degrees north. The `x` says to add 23×2.5 minutes, so we’re between 44° 57.5′ and 45° north of the equator.

Update: See a more extensive example here.

Update: Online calculator for converting between coordinates and Maidenhead locators here.