geoprimsField-grade geospatial math

ECEF to latitude, longitude, and height

Converts Earth-centered, Earth-fixed X, Y, Z to geodetic latitude, longitude, and ellipsoidal height, in closed form at any height.

Go the other way: Latitude, longitude, and height to ECEF →

40.446111°

Latitude 40.446111°, longitude -79.982222°, ellipsoidal height 300 m.

Longitude
Ellipsoidal height
Provenance
Computed by
geodesy.frame.ecef-to-geodetic 1.0.0, core 0.1.0
Model
ECEF to geodetic (Vermeille closed form), WGS 84
Accuracy
Round trips close within 5 nm near the Earth's surface (a few units in the last place) and within 1e-15 of the distance at any height; matches GeographicLib CartConvert
Notes
None
Cites
Karney, C. F. F., GeographicLib, GeographicLib Geocentric and LocalCartesian classes; National Geospatial-Intelligence Agency, Department of Defense World Geodetic System 1984, NGA.STND.0036

Something look off?

Your values

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

Loading…

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

Model: Vermeille (2011) closed form, as in GeographicLib's Geocentric class: no iteration

Accuracy: Round trips close within 5 nm near the Earth's surface (a few units in the last place) and within 1e-15 of the distance at any height; matches GeographicLib CartConvert

When to use this: Use this when a position arrives as Earth-centered X, Y, Z — from a GNSS receiver's raw output, a satellite product, or a coordinate exchange — and you need it as latitude, longitude, and height to plot or compare it. It is the inverse of the geodetic-to-ECEF tool and holds at any height, from below the surface to orbit.

Limitations: The height is above the ellipsoid, not above mean sea level: the geoid tool supplies the separation that turns one into the other. The frame the X, Y, Z came in matters as much as the arithmetic — ITRF, a WGS 84 realization, and a regional frame differ by centimeters to meters — and this conversion does not change frames or epochs.

Worked example: Pittsburgh at 300 m. Source: GeographicLib CartConvert -r: 40.446111, -79.982222, 300 m.

You enter

X
845580.01037 m
Y
-4786836.716953 m
Z
4116002.385436 m

You get

Latitude
40.446111°
Longitude
-79.982222°
Ellipsoidal height
300 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: 30 golden test vectors (download the test vectors, each with its source and tolerance). See how results are checked and every source.

Sources

Terms

ECEF: Earth-centered, Earth-fixed
Cartesian X, Y, Z coordinates in meters from Earth's center, turning with the Earth. X points to 0° longitude on the equator and Z to the North Pole. Source: Department of Defense World Geodetic System 1984