Latitude, longitude, and height to ECEF
Converts geodetic latitude, longitude, and ellipsoidal height to Earth-centered, Earth-fixed X, Y, Z.
ECEF X 845,580.01 m, Y -4,786,836.717 m, Z 4,116,002.385 m.
- Y
- Z
Provenance
- Computed by
- geodesy.frame.geodetic-to-ecef 1.0.0, core 0.1.0
- Model
- Geodetic to ECEF, WGS 84
- Accuracy
- Exact formula in double precision; matches GeographicLib CartConvert to 1 µm
- 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?
How we got thisFormula, worked example, sources, and proof
Model: X = (N + h) cosφ cosλ, Y = (N + h) cosφ sinλ, Z = (N(1 − e²) + h) sinφ
Accuracy: Exact formula in double precision; matches GeographicLib CartConvert to 1 µm
When to use this: Use this when a calculation wants Cartesian coordinates rather than angles: baselines between stations, vector arithmetic on positions, satellite geometry, or feeding a system that works in X, Y, Z. It takes latitude, longitude, and ellipsoidal height on the ellipsoid you choose. It is also the step before any vector arithmetic between two positions: differences, baselines, and rotations are done in Cartesian space, not on latitudes and longitudes.
Limitations: The height must be ellipsoidal; passing a height above mean sea level puts the point off by the geoid separation, which reaches tens of meters. The result is only as well defined as the frame its input belongs to, and this tool converts coordinates rather than datums, frames, or epochs. The ellipsoid matters: the same latitude, longitude, and height on a different ellipsoid gives different X, Y, Z, so the ellipsoid has to be the one the coordinates belong to.
Worked example: Pittsburgh at 300 m. Source: add-geodesy-suite scenario: X ≈ 845,580.010 m, Y ≈ −4,786,836.717 m, Z ≈ 4,116,002.385 m. It is golden test vector v001, and every build checks the tool still gives its answer within its tolerance.
You enter
- Ellipsoidal height
- 300 m
- Latitude
- 40.446111 deg
- Longitude
- -79.982222 deg
You get
- X
- 845,580.01 m
- Y
- -4,786,836.717 m
- Z
- 4,116,002.385 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
- 2026-09-19, changed: The four frame conversions are stable: geodetic to ECEF and back, and to and from a local east-north-up frame. They reproduce the IOGP Guidance Note 7-2 worked examples and agree with GeographicLib's CartConvert within 15 nm on 1,000 ECEF points (poles to beyond geostationary orbit) and 500 local targets. Results are unchanged. Changelog
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
- GeographicLib Geocentric and LocalCartesian classes, Karney, C. F. F., GeographicLib, GeographicLib 2.x. Geocentric.cpp: Vermeille's closed-form inverse; LocalCartesian.cpp: ENU rotation. Read free.
- Department of Defense World Geodetic System 1984, NGA.STND.0036, National Geospatial-Intelligence Agency, NGA.STND.0036_1.0.0_WGS84. Table 3.1 (defining parameters) and Table 3.3 (derived geometric constants).
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