geoprimsField-grade geospatial math

Latitude and longitude to MGRS

Encodes a WGS 84 latitude and longitude as an grid reference at any precision, truncating (never rounding) as the standard requires.

Go the other way: MGRS to latitude and longitude →

17TNE8630977770

The MGRS reference is 17T NE 86309 77770, a 1 m square.

MGRS (spaced)
Square size
Provenance
Computed by
geodesy.grid-ref.mgrs-forward 1.0.0, core 0.1.0
Model
NGA MGRS (AA lettering) over UTM and UPS on WGS 84
Accuracy
Exact; the reference names the square containing the point (truncation)
Notes
None
Cites
National Geospatial-Intelligence Agency, Military Grid Reference System, NGA.STND.0037; Karney, C. F. F., GeographicLib, GeographicLib MGRS and UTMUPS classes

Something look off?

Your values

Showing an example. Change anything.
Run many at once from a CSV

Loading…

How we got thisFormula, worked example, sources, and proof

Model: NGA MGRS (AA lettering) over UTM and UPS on WGS 84

Show your work

  1. Grid position

    the UTM or UPS zone, easting, and northing the point falls at

    40.446111°, -79.982222° = zone 17, 586,310 m E, 4,477,770 m N

  2. Square

    how much of the easting and northing the chosen precision keeps

    precision 5 = 1 m across

  3. Reference

    zone, band, 100 km square, then the kept digits

    zone 17 at precision 5 = 17TNE8630977770

The same steps an agent gets from the MCP server with explain: true.

Accuracy: Exact; the reference names the square containing the point (truncation)

When to use this: Use this when a position has to be written the way military and emergency services read it: an MGRS reference at the precision you choose, from a 100 km square down to a meter. It is the form used on ground operations, in search and rescue, and on maps that carry the grid.

Limitations: The reference names the square that contains the point, because MGRS truncates rather than rounds: a ten-digit reference is a one-meter square whose south-west corner is the position given, and a shorter one names a larger square. It is defined on UTM and UPS, so it carries their zone structure, and the coordinates here are WGS 84.

Worked example: Pittsburgh at 1 m. Source: add-geodesy-suite scenario: 17TNE8630977770. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.

You enter

Latitude
40.446111 deg
Longitude
-79.982222 deg

You get

MGRS
17TNE8630977770
MGRS (spaced)
17T NE 86309 77770
Square size
1 m

Review: Not yet independently reviewed by a geodesist.

Last verified: 2026-09-18, when a maintainer last confirmed this tool's sources at the issuer. See the sources ledger.

Status: version 1.0.0, core 0.1.0. See this tool in the verification report.

Changes

Checked against: 25 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

MGRS: Military Grid Reference System
UTM and UPS coordinates written as a zone, a latitude band, a two-letter 100 km square, and digits, like 17T NE 86309 77770. Source: NGA.STND.0037 MGRS

MGRS — Military Grid Reference System

UTM and UPS coordinates written as a zone, a latitude band, a two-letter 100 km square, and digits, like 17T NE 86309 77770.

Source: NGA.STND.0037 MGRS