Currently, the formula I'm using to convert MGRS to Lat/Long and vice versa is giving me slightly different results than most other conversion utilities. It's usually between 10 to 30 feet off. This isn't a very big difference, but it matters for the particular application of data. I'm wondering if anyone knows of a simple library that does conversions between MGRS and Lat/Long or UTM.

3 Answers 3


alt text


  • 1
    I'm not looking for a utility to perform the conversion. I wanted to know if there was a PHP class out there.
    – Nathan
    Commented Dec 18, 2010 at 17:42


which is also downloadable (including the FORTRAN source). USNG is a simplified version of MGRS. Datum is usually NAD83 and you don't have to handle the different letter schema based on the datum/ellipsoid. In MGRS, NAD27 data would have a different letter schema than NAD83.

Geotrans 3.0


which is in C or Java also has source code available.


I would recommnend you to use USNG library to convert

LL to USNG (function LLtoUSNG(lat, lon, precision))

LL to MRGS (function LLtoMGRS(lat, lon, precision))

LL to UTM (Note: UTM calculations are an intermediate step in LLtoUSNG conversions but can be used as seperate function if required)

and more, plus reverse

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.