This post shows the step by step process of decoding a Maidenhead locator code to calculate the latitude and longitude at the centre of a square. I have used this calculation in logging software I have been continuously developing the last three years.
Maidenhead locator codes are used to identify the operators location and are often referred to as a QTH locator, grid locator or grid square. Besides other things they and are used in contesting not only a means to identify the location but also to calculate contest points.
Over the last three years I’ve been continuously developing my logging software to record my amateur radio contacts. I initially wrote the program to log general contacts but recently enhanced to include contest logging features.
A requirement of my software is to calculate the distance between the centre of the Maidenhead locator of my QTH and the centre of the remote operators Maidenhead locator code.
I’ve written this post because despite finding lots of computer programs and apps that automatically do it for you, people posting code of computer programs written to do it and information that is complicated to understand, I could not find anywhere where the process is easily explained. There is nothing complex in this; just basic maths. So apart from a calculator (or not) the only other thing you will need to do the decode is an ASCII character set chart, which I have added a link to below.
Firstly you need to understand a few key things about the locator:
- The first pair of characters represent latitude and longitude ( ‘I‘ = longitude, ‘O‘ = latitude).
- The pair of numbers ‘93‘ represent a square. Each square represents 1° of latitude by 2° of longitude.
- The second pair of letters ‘ob‘ represent a sub-square. They are mostly (but not always) lower case. Each pair of letters represents of 2.5′ of latitude by 5′ of longitude.
More information about exactly how Maidenhead locators work can be found at the bottom of this post.
So how do you convert a Maidenhead locator code of IO93ob? Lets go!
ASCII CHARACHTER SET
Firstly you’ll need an ASCII character code set. Click here to open.
DECODE LATITUDE
There are four steps (1, 2, 3 and 4) required to decode the latitude locator code IO93ob:
Step 1:
1a) Find the ASCII charachter code for the 2nd character of the locator code
O = 79
1b) Deduct 65 from 79
79 – 65 = 14
1c) Multiply by 10
14 x 10 = 140
Step 2:
2a) Get number from position 4
3
Step 3:
3a) Find the ASCII charachter code for the 6th character of the locator code
b = 98
3b) Deduct 97 from 98
98 – 97 = 1
3c) Divide by 24
1 / 24 = 0.041667
3d) Add (1/48)
0.041667 + (1 / 48)) = 0.0625
3e) Deduct 90
0.0625 – 90 = -89.9375
Step 4:
Latitude = [result from step 1] + [result from step 2] + [result from step 3]
Latitude = 140 + 3 + -89.9375
Latitude = 53.0625
DECODE LONGITUDE
There are four steps (1, 2, 3 and 4) required to decode locator code IO93ob:
Step 1:
1a) Find the ASCII charachter code for the 1st character of the locator code
I = 73
1b) Deduct 65 from 73
73 – 65 = 8
1c) Multiply by 20
8 x 20 = 160
Step 2:
2a) Get number from position 3
9
2b) Multiply by 2
9 x 2 = 18
Step 3:
3a) Find the ASCII charachter code for the 5th character of the locator code
o = 111
3b) Deduct 97 from 111
111 – 97 = 14
3c) Divide by 12
14 / 12 = 1.1666
3d) Add (1/24)
1.1666 + (1 / 24)) = 1.20826
Step 4:
4a) Add results A, B and C then deduct 180
(160 + 18 + 1.20826) – 180 = -0.792
Latitude = -0.792
ANSWER
The latitude and longitude at the centre point of Maidenhead locator square is 53.0625, -0.792
TESTING
I plotted Maidenhead locator square IO93ob on the map (red square) and then plotted latitude and longitude 53.0625, -0.792 (red dot). As you can see this is dead centre of the square.
And it is as simple as that! In another post I will be showing how to calculate the distance between the centre of two different locator codes using latitudes and longitudes calculated using the above process.
POWERPOINT PRESENTATION
I have now created a MS PowerPoint presentation that explains the process above. Get it by clicking the button below:
MAIDENHEAD LOCATOR SYSTEM
More information about exactly how the Maidenhead system works can be found here.
Why not take a look at my YouTube channel here or Twitter posts here.
You can also register for my website here.
Thanks
73 de M0NWK
6 comments
Very well explained. Do you know any online tool that convert Maidenhead locator to Lati Long coordinates? Something like this website that converts between Lati Long formats https://latitude-longitude.net . It was great if there was a similar website where we could simply put the Maidenhead locator code and the map show its location and GPS coordinates.
Excellently done. This Maidenhead code is, by some quirk, MY house. So, I didn’t need to do the maffs, necessarily. Or, is there some mechanism that deduces where you are and does this? 😀
Hi Ian, nothing intelligent there. Just fluke. Glad you found it useful. Thanks for your comments. 73 Ade
Terrific on the maths! I was able to make up a C++ class in short order. It also forced me to go learn how it was all dreamed up in the first place. Doing this for 4 character Maidenheads is somewhat simpler, and since that is usually what we use on HF, very handy.
Thanks and 73 from FM16
Mitch, AB4MW
Majic – I just set up excel with your instructions and have converted 600 records in an afternoon. Amazing.
I have used the data to setup PINs on google to show me all of the Winlink RMS Stations.
Brilliant thanks
Not on FB, X, P or in any longer I’ll check out the YouTube.
Further: Assuming data(GRID) is in D3 and 1/24 is in Q1. I have other reasons for this.
in cells J to R of row 3 in this case.
Formula used is between [ ] to represent the Cell
D3 [ GK03ED ]
J3 [ =0*((CODE(MID($D3,2,1)))-65) ]
K3 [ =MID(D3,4,1) ]
L3 [ =((((CODE(MID($D3,6,1))-97))/24)+1/48-90) ]
Lat therefore
M3 [ =J3+K3+L3 ]
O3 [ =((CODE(LEFT($D3,1)))-65)*20 ]
P3 [ =(MID($D3,3,1))*2 ]
Q3 [ =(((CODE(MID($D3,5,1))-97))/12)+$Q$1 ]
Lon therefore
R3 [ =O3+P3+Q3-180 ]
I then S3 [ =ROUNDUP(M3,6) ]
I then T3 [ =ROUNDUP(R3,6) ]
I then V3 [ =CONCAT(S3,”,”,T3)
Hope that helps somebody too
Stephen G6SGA