How to Calculate a Bearing Between Two Points
Enter two latitude/longitude positions to compute true bearing, magnetic bearing, reciprocal bearing, and great-circle distance.
Latitude must be between -90 and 90. Longitude must be between -180 and 180. The calculator uses spherical trigonometry for initial great-circle bearing.
Ready: enter coordinates and press Calculate Bearing.
Expert Guide: How to Calculate a Bearing Between Two Points
Knowing how to calculate a bearing between two points is a foundational skill in navigation, surveying, geospatial analysis, aviation planning, marine routing, and even outdoor recreation. A bearing tells you the direction from one point to another, usually measured clockwise from true north. If your first point is a city, a vessel position, or a GPS waypoint, and your second point is your destination, the bearing answers a practical question: “Which direction do I need to go right now?”
In modern applications, bearings are often computed from latitude and longitude coordinates. That sounds straightforward, but there are important details. Earth is not flat, so a straight line on a map may not match the shortest route on a globe. Bearings can be true or magnetic. Bearings can also change as you move on a curved Earth, especially over long distances. This guide explains the concepts, formula, and practical steps so you can compute bearings accurately and understand what the output really means.
What Exactly Is a Bearing?
A bearing is an angle measured clockwise from north to a line pointing toward a target. For example:
- 0° means due north.
- 90° means due east.
- 180° means due south.
- 270° means due west.
In navigation software, this is usually called an initial bearing (or forward azimuth) when calculated from start point to destination. If you reverse direction, you get a reciprocal bearing, often close to the original bearing plus or minus 180° (with normalization to 0-360).
True Bearing vs Magnetic Bearing
True bearing is measured from geographic north (the North Pole). Magnetic bearing is measured from magnetic north, which is offset from true north by local magnetic declination. Declination varies by location and changes gradually over time due to movement in Earth’s magnetic field. If you are using a compass in the field, this distinction matters. If you are using GIS or aviation route tools, true bearing is often the default.
Rule of thumb: Magnetic bearing = True bearing – Declination (if declination is east-positive). Always confirm the sign convention used by your map, app, or organization.
The Core Formula for Bearing from Latitude and Longitude
For two points on a sphere:
- Convert all latitudes and longitudes from degrees to radians.
- Compute the longitude difference: Δλ = λ2 – λ1.
- Compute intermediate values:
- x = sin(Δλ) × cos(φ2)
- y = cos(φ1) × sin(φ2) – sin(φ1) × cos(φ2) × cos(Δλ)
- Initial bearing in radians: θ = atan2(x, y)
- Convert θ to degrees and normalize to 0-360: (θ × 180/π + 360) mod 360
This gives the initial great-circle bearing, which is the correct directional angle to start along the shortest surface route on Earth (under spherical assumptions).
Step-by-Step Practical Workflow
- Collect coordinate inputs: Ensure decimal degrees and correct signs (north/east positive, south/west negative).
- Validate ranges: Latitude must be -90 to 90, longitude must be -180 to 180.
- Run the initial-bearing formula: Use atan2, not basic arctan, to preserve correct quadrant.
- Normalize output: Force result into 0-360 to avoid negative bearings.
- Optionally convert units: radians for programming, mils for military contexts, or keep degrees for maps.
- Apply declination if needed: Convert true to magnetic for compass use.
- Interpret direction by sector: Example, 22.5° to 67.5° maps to northeast.
Why Bearing Changes on Long Routes
On a flat map, you might expect one fixed direction all the way to destination. On a sphere, a great-circle path curves relative to latitude/longitude grid lines. That means your heading can drift over distance even if you remain on the shortest path. Aircraft and long-range marine routes account for this continuously. For short distances, the change is usually small enough that a single initial bearing is often sufficient for many practical tasks.
Distance Context Improves Bearing Interpretation
A bearing alone gives direction, not how far to travel. Pair it with great-circle distance using the haversine formula. This gives stronger situational awareness: “Go 71.2° for 412 km,” rather than direction only. In route planning, this combination supports waypoint design, ETA calculations, and fuel estimation.
Comparison Table: Longitude Degree Distance by Latitude
One reason bearings and map behavior can feel counterintuitive is that longitude spacing shrinks as you move away from the equator. The values below are standard geodesy approximations for Earth.
| Latitude | Approximate Length of 1° Longitude | Implication for Navigation |
|---|---|---|
| 0° (Equator) | 111.32 km | East-west movement covers maximum ground per degree. |
| 30° | 96.49 km | Grid distortion starts becoming noticeable. |
| 45° | 78.85 km | Bearing and map scale differences become operationally relevant. |
| 60° | 55.80 km | Degree spacing is roughly half of equator value. |
| 80° | 19.39 km | Small longitude changes can represent short ground distances. |
Comparison Table: Typical Position Accuracy and Bearing Reliability
Bearing quality is tied to coordinate quality. If points are noisy, the directional result can fluctuate, especially at short ranges.
| Positioning Method | Typical Horizontal Accuracy | Bearing Confidence Use Case |
|---|---|---|
| Smartphone GNSS (open sky) | 3 m to 10 m | Good for general outdoor navigation, less stable for very short baselines. |
| Consumer GNSS with SBAS | 1 m to 3 m | Improved waypoint-to-waypoint directional consistency. |
| Survey-grade GNSS with RTK | 0.01 m to 0.03 m | High-precision azimuth workflows and engineering-grade field work. |
Common Mistakes and How to Avoid Them
- Mixing degree and radian inputs: Trig functions in JavaScript use radians.
- Swapping longitude and latitude: Keep strict ordering in data pipelines.
- Forgetting normalization: Negative angles should be converted to 0-360.
- Using planar math at global scale: Cartesian shortcuts fail over long distances.
- Ignoring declination: Compass alignment errors can be significant in some regions.
- Computing bearing on nearly identical points: Small GPS jitter can create unstable output.
Field and Professional Use Cases
In hiking and search operations, bearing calculators help teams align GPS coordinates with map-and-compass movement. In drone and aviation planning, bearing informs heading for route legs, while autopilot systems continuously adjust as the craft follows geodesic or programmed paths. In marine applications, true bearings are essential for chart plotting, then converted to magnetic when needed for onboard compass references. Surveyors use highly precise coordinates and often compute azimuths repeatedly between control points to verify network consistency.
In geospatial analytics, bearing can become a feature variable. For example, logistics platforms use origin-destination bearings to cluster route directionality, assess wind exposure impacts, or optimize dispatch patterns. Environmental studies can use directional relationships between sensor nodes and emission sources. The same core formula appears across all these domains, but quality requirements differ: recreational users may accept a few degrees of drift, while engineering and cadastral work demand tighter controls and robust QA procedures.
How This Calculator Interprets Your Inputs
This calculator computes:
- Initial true bearing from start to destination on a spherical Earth model.
- Reciprocal bearing for the reverse direction.
- Magnetic bearing after applying declination.
- Great-circle distance in kilometers and miles via haversine.
- Compass sector such as NNE, ENE, SW, and so on.
The chart highlights the compass sector of your calculated bearing so you can interpret direction visually, not just numerically.
Authoritative References for Deeper Study
- NOAA Great Circle Calculator (.gov)
- FAA Magnetic Variation Resources (.gov)
- U.S. Naval Academy Great Circle Navigation Notes (.edu)
Final Takeaway
If you remember one thing, remember this: use spherical formulas with validated coordinates, then normalize and interpret carefully. Bearing calculation is not just a math exercise. It is a directional decision tool used in real movement and real operations. By combining true bearing, magnetic correction, and distance context, you get outputs that are reliable, practical, and suitable for serious navigation workflows.