Guide · updated 2026-09-30

How to calculate the bearing between two points

Short answer

The initial bearing from point A to point B is atan2(sin Δλ · cos φ2, cos φ1 · sin φ2 - sin φ1 · cos φ2 · cos Δλ), converted to degrees clockwise from true north. On a long trip the bearing changes along the way: leaving Denver for Boston you head 73° and arrive heading 96°.

What a bearing is

A bearing is the direction from one point to another, measured in degrees clockwise from true north. North is 0°, east 90°, south 180° and west 270°. A bearing of 73° points a little north of east, ENE on a 16 point compass.

True north is the direction to the geographic North Pole. A magnetic compass points to magnetic north instead, and the difference, called declination, depends on where you stand and drifts over the years. This site does not ship a declination model, so every bearing here is a true bearing.

The formula, step by step

Convert the latitudes φ1 and φ2 and the longitude difference Δλ to radians. Then:

y = sin Δλ · cos φ2
x = cos φ1 · sin φ2 - sin φ1 · cos φ2 · cos Δλ
θ = atan2(y, x)
bearing = (θ in degrees + 360) mod 360

The atan2 function returns an angle from -180° to 180° and uses the signs of y and x to pick the right quadrant. Adding 360 and taking the remainder turns it into a compass bearing from 0° to 360°. In Excel, note that ATAN2 takes x first: =MOD(DEGREES(ATAN2(x, y))+360,360).

Initial, final and constant bearings

The formula gives the bearing at the start of the shortest path. Because a great circle crosses each meridian at a different angle, the heading changes as you travel. The final bearing is the reverse of the initial bearing from B back to A, turned around by 180°. From Denver to Boston the initial bearing is 73.0° and the final bearing is 95.7°.

If you hold one compass heading the whole way, you follow a rhumb line instead. Its constant bearing from Denver to Boston is 84.2°. The rhumb line is easier to steer and longer to travel. The great circle vs rhumb line guide measures how much longer.

Bearings from Washington, DC to every state capital

Sorted clockwise from north. The difference between the initial and final columns shows how much each route turns. Short routes barely turn; routes to Juneau and Honolulu turn the most.

CapitalInitialFinalRhumbMiles
Harrisburg, PA4.9°5.0°5.0°94
Montpelier, VT30.4°33.4°31.9°436
Albany, NY32.5°34.6°33.5°310
Concord, NH42.2°45.8°43.9°413
Augusta, ME42.8°47.6°45.1°528
Hartford, CT47.9°50.7°49.3°303
Boston, MA50.8°54.7°52.7°393
Trenton, NJ52.5°54.0°53.2°152
Providence, RI53.9°57.5°55.7°358
Dover, DE77.6°78.5°78.0°83
Annapolis, MD80.2°80.5°80.4°30
Richmond, VA193.0°192.7°192.8°97
Raleigh, NC202.7°201.7°202.2°233
Columbia, SC214.5°212.1°213.2°405
Tallahassee, FL217.3°213.1°215.1°715
Atlanta, GA231.2°226.8°228.9°542
Montgomery, AL231.8°226.4°229.0°688
Baton Rouge, LA238.2°230.1°234.0°992
Jackson, MS242.2°234.6°238.2°867
Austin, TX249.3°237.5°243.1°1,316
Nashville, TN253.5°247.5°250.5°566
Little Rock, AR255.9°246.7°251.2°890
Charleston, WV262.4°259.5°260.9°250
Oklahoma City, OK264.5°252.1°258.2°1,148
Frankfort, KY265.8°260.9°263.3°426
Phoenix, AZ270.0°248.8°259.1°1,978
Santa Fe, NM271.1°253.3°262.0°1,597
Jefferson City, MO273.2°263.7°268.4°815
Topeka, KS276.4°264.7°270.6°1,000
Springfield, IL279.1°271.1°275.1°676
Indianapolis, IN279.8°274.1°277.0°491
Denver, CO281.1°263.2°272.2°1,489
Honolulu, HI281.6°234.9°255.8°4,829
Lincoln, NE283.4°270.8°277.2°1,049
Sacramento, CA283.8°255.1°269.5°2,372
Carson City, NV284.3°256.6°270.4°2,272
Columbus, OH284.8°281.0°282.9°326
Cheyenne, WY284.9°266.8°276.0°1,472
Salt Lake City, UT285.2°262.5°274.0°1,841
Des Moines, IA287.3°276.5°282.0°892
Boise, ID292.0°265.5°279.1°2,041
Pierre, SD295.0°279.4°287.4°1,256
Salem, OR295.3°263.6°280.0°2,368
Madison, WI298.1°289.9°294.1°704
Helena, MT298.2°274.0°286.7°1,836
Olympia, WA299.0°266.8°283.6°2,350
Saint Paul, MN302.1°291.3°296.9°923
Bismarck, ND302.3°286.0°294.5°1,314
Lansing, MI306.3°301.4°303.9°473
Juneau, AK317.6°272.3°297.5°2,832
True bearings on a sphere from the capitol coordinates stored on this site.

Where bearings are used

Hikers set a bearing on a baseplate compass after correcting for declination. Pilots and sailors plan legs by bearing and distance. Antenna installers aim a dish or a directional antenna at a tower by bearing. Solar installers compare the bearing a roof faces with the sun's azimuth, which the sun position calculator reports in the same clockwise from north convention.

From degrees to compass points

A 16 point compass splits the circle into slices of 22.5°. North covers 348.75° to 11.25°, north-northeast 11.25° to 33.75°, and so on around the dial. The calculators on this site show both the number and the nearest compass point, so a bearing of 73.0° from Denver to Boston reads as ENE. For navigation, use the number. The compass point is a label, and at 22.5° per slice it hides errors of up to 11 degrees, which over a 100 mile leg puts you about 20 miles off course.

Back bearings on long routes

On a short hike the back bearing is the forward bearing plus or minus 180°. On a long route it is not, because the great circle turns. Leaving Boston for Denver, the initial bearing is 275.7°. That is not 253.0°, the reverse of the Denver to Boston start. It is the reverse of the Denver to Boston final bearing, 95.7° turned by 180°.

The gap between the two start bearings, 22.7 degrees here, is a quick measure of how much the path curves compared with a flat map.

Try it

Bearing calculator

Initial, final, and rhumb bearings. True north (no WMM lookup).

Questions people ask

How do I calculate bearing in Excel?

With latitudes in B2 and B3 and longitudes in C2 and C3: =MOD(DEGREES(ATAN2(COS(RADIANS(B2))*SIN(RADIANS(B3))-SIN(RADIANS(B2))*COS(RADIANS(B3))*COS(RADIANS(C3-C2)),SIN(RADIANS(C3-C2))*COS(RADIANS(B3))))+360,360).

Is bearing the same as azimuth?

In mapping, yes. Both are measured clockwise from north in degrees. Some fields measure azimuth from south, so check the convention.

Why is the bearing from B to A not the opposite of A to B?

Because the great circle turns along the way. The reverse bearing equals the final bearing of A to B plus or minus 180 degrees, not the initial one.

Does this give magnetic or true bearing?

True bearing. Subtract east declination or add west declination for your location to get a magnetic compass reading.

Sources and data as of

Data as of: computed from the formulas shown and the capital coordinates stored on this site.

    How every number is computed: methodology. Spotted a wrong figure? Report an error.