East is least, west is best
Magnetic variation (magnetic declination) is the angle between true north and magnetic north. When variation is east, magnetic heading is less than true heading; when it is west, magnetic heading is greater:
magnetic = true − east variation = true + west variation
A true heading of 360° with 15° east variation is a magnetic heading of 345°. A true heading of 090° with 10° west variation is a magnetic heading of 100°. The same arithmetic converts a true course to a magnetic course. It does not include wind: to get heading from course, use the E6B wind-triangle calculator.
Compass deviation
The magnetic compass in the airplane has its own error, called deviation, plotted on the compass correction card as a function of heading. East deviation is subtracted from magnetic heading to get compass heading, west deviation is added — the same “east is least, west is best” memory item. If you leave deviation blank, compass heading equals magnetic heading.
You can enter a true, magnetic, or compass value and the other two are filled in. Variation comes from the isogonic lines on the chart, or from a current magnetic model; it changes slowly from year to year. For picking a runway with a true METAR wind, the runway selection calculator also applies variation.
Sources
FAA Pilot's Handbook of Aeronautical Knowledge (magnetic variation, compass deviation, “east is least, west is best”); FAA Aeronautical Information Manual (isogonic lines; runway numbering is magnetic).
Frequently asked questions
What magnetic heading is 360° true with 15° east variation?
345°. East is least: subtract 15° from 360°, which wraps to 345° magnetic.
What about 090° true and 10° west variation?
100° magnetic. West is best: add 10° to 090°.
Does this include a wind-correction angle?
No. These identities convert true, magnetic, and compass heading or course only. For heading from course and wind, use the E6B wind-triangle calculator.