ECEF and geodetic coordinates
GPS hardware and orbital software often work in Earth-Centered, Earth-Fixed (ECEF) Cartesian coordinates: a point is just an X, Y and Z distance in metres from the planet’s center. Humans and maps prefer geodetic latitude, longitude and altitude. This tool converts the former into the latter on the WGS-84 ellipsoid.
How it works
Longitude is straightforward: it is the angle in the equatorial plane, computed
as atan2(Y, X). Latitude is harder because the Earth is an ellipsoid, not a
sphere. The converter uses Bowring’s closed-form method, which estimates an
auxiliary angle and then solves for the geodetic latitude in one step using the
first and second eccentricities of the ellipsoid.
X 4201152.8, Y 168331.8, Z 4780461.6 -> 48.8584 N, 2.2945 E, alt 330 m
Once latitude is known, the radius of curvature in the prime vertical gives the ellipsoidal altitude.
Example and tips
The altitude returned is height above the ellipsoid; subtract the local geoid undulation if you need height above sea level. Inputs are in metres, so a typical ground point has values in the millions. Use the result with the Lat/Lng to Plus Code or Maidenhead tools to express the same location in other systems.