Welcome to Radarspotting. Please login or sign up.

May 18, 2026, 07:00:55 AM

Login with username, password and session length

New Members

New Members

You should get an activation email when you join.  If not, please use the Contact option.

USA Hex Code Range

Started by Pete, February 04, 2023, 10:59:44 AM

Previous topic - Next topic

0 Members and 1 Guest are viewing this topic.

Pete

Hi.  Can anyone please help with the hex code ranges for US civil and US military?  Many thanks.  Pete

Pete

I've just done  a bit more digging.  The US civil codes start at A00000 and the military at AE0000.  It's just the end of these ranges that I require.  Thanks.

Faramir

If it helps, these are the lines from my Countries.dat file for the US:

United States=1010xxxxxxxxxxxxxxxxxxxx,4,United_States.bmp
United States Mil=1010111xxxxxxxxxxxxxxxxx,7,United_States_Mil.bmp
United States Mil=1010110111111xxxxxxxxxxx,13,United_States_Mil.bmp
United States Mil=1010110111110111111xxxxx,19,United_States_Mil.bmp
United States Mil=10101101111101111101xxxx,20,United_States_Mil.bmp
United States Mil=101011011111011111001xxx,21,United_States_Mil.bmp

Pete

Hi Faramir.  Thank you for the information and I understand that you can convert the bin 1010xxx etc to hex A00000 and the same with 1010111xxx etc to AE0000.  However, that's where my mathematical abilities end and I'm unsure how to work out the last number (either bin or hex) in those given sequences.  I'm hoping there are some really clever people out there who could help me.  Thanks again for your reply - are you one of those really clever people? Regards Pete

Faramir

Definitely not one those clever people Pete. But I think I understand how the mode-s country scheme in Basestation works. The Mode-S code is a hexadecimal notation of a 24-bit (3-byte) binary code.
In the Countries.dat file (where the lines in my earlier post came from) the ranges are defines by the specified bits, the x'es can be a 0 or a 1 it doesn't matter. More lines per nation define as many 'blocks' of codes.
With the 'Countries.dat' file Basestation 'tests' a code against that file to learn in which country it belongs.
ICAO only allocates a 'block' to complete nation and doesn't differentiate between military of civil blocks. That's up the nations themselves.
An overview of the allocated blocks to nations can be found here

The Dutch Department of Transport did give the information abou the civil and military blocks. Perhaps the FAA is willing to help. I'd send them an email them and ask friendly. If you use Basestation I can get you a utility that test a hexadecimal code against the Countries.dat file.

Cheers,
John

Anmer

Here to Help.

Pete

Thanks, John.  That's led me to the answer of my question, with the range of the US block from A00000 to AFFFFF.  Therefore, I have assumed the US civil block will end at ADFFFF with the military block starting at AE0000 and in theory going onto AFFFFF.  I had downloaded a bin to hex converter which helped a great deal.  I then found a hex calculator, as I couldn't get my head around what AE0000 minus 1 was.  When I saw it was ADFFFF it was obvious!  Thanks again for your help.  Pete

Pete

Thanks Anmer.  I read your post after I'd replied to an earlier one.  I've printed it off so I can experiment further.  Pete

Faramir

That's great Pete! Your post makes me try only two lines in countries.dat for the US. For the time being all code's are placed in the right block. I'll see what it will do in the coming weeks but if the two lines work well that saved me a couple of lines making BaseStation start faster so thanks for bringing it up :-)

jakems

Hi

The USA has been allocated A00000 to AFFFFF. The FAA has devised an algorithm to generate a hexcode of every civil N registration. This algorithm uses A00001 to ADF7C7. So this leaves A00000 and ADF7C8 to AFFFFF for the US Military. The 6 lines from the Countries.dat that Faramir posted allocates the whole block from A00000 to AFFFFF to civil registrations in line 1. It then uses lines 2 to 6 to sub allocate all the codes from ADF7C8 to AFFFFF to the military. This is what I have in my Countries.dat. I suppose if you wanted you might add a line to allocate A00000 to the military as well. But this all said the military in the US and other countres seem to use what every code they want, irrespective of what they have been allocated, for "special missions".
Steve

DaveReid

If it helps, the lowest US military codes I have seen allocated (not necessarily current) are/were a bunch of FY89 to FY95 T-1A Jayhawks in the range ADFC60 to ADFD13.