Guides

Magnetic Compass Deviation

A practical guide to magnetic compass deviation, compass swing readings, and the NDLSK calculator that turns observed errors into a deviation curve.

Conceptual magnetic compass deviation diagram

A magnetic compass looks like a very simple instrument until it starts lying to you differently on different headings.

That is the annoying part. The compass may look fine on one course and then be a degree or two off on another. Sometimes more. Not because the compass is mystical, and not because north changed its mind, but because the vessel itself has its own magnetic influence: steel, wiring, electronics, speakers, tools, cargo, batteries, chargers, and all the other things that slowly gather around a real working boat.

That vessel-specific error is called deviation.

It is not the same as variation. Variation belongs to the place on Earth. Deviation belongs to the vessel. This article is about deviation, compass swing readings, and the small Deviation Calculator that turns those readings into a curve, coefficients, and a cleaner table.

The calculator does not measure deviation by itself — the readings still have to be taken properly. But once you have them, it can build the deviation curve, calculate the A/B/C/D/E coefficients, show residual errors, and help check whether the observed headings look consistent. This is the same kind of calculation used to prepare deviation tables that later end up next to the compass.

Why compass deviation matters

A magnetic compass feels almost old-fashioned now, because most of the time the screen looks easier. GNSS gives position, the chartplotter draws the world, AIS adds targets, and the boat suddenly feels very modern. Until the signal is wrong, weak, jammed, spoofed, or simply not available in the way you expected.

This is not a theoretical fear. Civil GPS used to have Selective Availability, an intentional degradation of the public signal that was discontinued in May 2000. During the first Gulf War, civilian GPS receivers were also used because there were not enough military units available, and Selective Availability was temporarily lifted to make those receivers useful. Later, in June 2017, the U.S. Maritime Administration issued an alert about reported GPS interference in the Black Sea near Novorossiysk. Ships in that area were reported as showing positions that did not match reality, including positions inland near an airport. More recently, GNSS jamming and spoofing have been reported in places like the Baltic Sea and other conflict-adjacent waters.

So the magnetic compass is not just a decorative backup from an older century. It is one of the independent references left on board when electronic navigation becomes questionable. But for that backup to be useful, its own error has to be known.

That is where deviation matters. One degree does not sound dramatic when you say it out loud, but over distance it can quietly move a vessel away from where it was meant to go. The bigger problem is that deviation is not usually one fixed number. A compass can be almost correct on north, slightly wrong on east, and noticeably wrong somewhere else.

Writing down one correction and pretending it solves everything is not very useful. What you want is the shape of the error around the compass.

That shape is the deviation curve.

Variation and deviation are not the same thing

There are three norths involved here, and mixing them up makes everything harder than it needs to be.

  • True north is the geographic north used on charts.
  • Magnetic north is the direction of the Earth’s magnetic field at your position.
  • Compass north is where the boat’s compass actually points after the vessel has had its say.

Variation is the difference between true north and magnetic north. It depends on where you are on Earth and comes from charted or geomagnetic information.

Deviation is the difference between magnetic north and compass north. It comes from the vessel itself and changes with heading, because the relationship between the compass and the boat’s magnetic environment changes as the vessel turns.

The Deviation Calculator only deals with deviation. It does not include chart variation, does not convert true and magnetic courses, and does not replace normal navigation work. It simply takes observed deviation values and turns them into a more readable record.

A curve is more useful than one correction

Compass deviation is better understood as a curve around the full 360 degrees, not as a handful of unrelated numbers.

A compass swing usually gives readings on the main headings: N, NE, E, SE, S, SW, W, and NW. Those eight points are useful, but the real value is seeing how they connect. A smooth curve tells you more than a lonely correction value ever could.

The model used in the calculator describes deviation with five coefficients:

  • A: constant deviation;
  • B and C: semicircular deviation;
  • D and E: quadrantal deviation.

You do not need to become emotionally attached to every coefficient. In normal use, the important thing is the curve and the table it produces. The coefficients are the compact mathematical way of describing that curve.

Before using the calculator

The calculator expects eight observed deviation values, one for each main heading.

Those values should come from a compass swing or a proper deviation check. The tool does not know whether the readings were taken well. It does not know whether the reference was stable, whether the steering was steady, or whether somebody placed a suspiciously magnetic object near the compass five minutes before the test.

So the old rule still applies: the output is only as good as the input.

If the readings are rough, the result will be rough. If one heading was recorded incorrectly, the curve may still draw beautifully, but it will be beautifully wrong.

How to use the calculator

Open the Deviation Calculator and enter the observed deviation for each heading.

Use the sign exactly as recorded:

  • positive values for easterly deviation;
  • negative values for westerly deviation.

For example, if the observed deviation on NE is 2.4 degrees east, enter 2.4. If it is 1.8 degrees west, enter -1.8.

The tool uses these headings:

  • N: 0 degrees;
  • NE: 45 degrees;
  • E: 90 degrees;
  • SE: 135 degrees;
  • S: 180 degrees;
  • SW: 225 degrees;
  • W: 270 degrees;
  • NW: 315 degrees.

Each field expects a number in degrees. Do not add E, W, plus signs, or text labels. Use values like 1.6, 0.4, -0.9, or -2.0.

What the buttons do

The calculator has two main controls.

Calculate curve takes the eight values currently in the fields and rebuilds the result. Use it after entering your own readings or after changing one value.

Generate set fills the fields with a realistic sample set and calculates it immediately. This is only for testing the layout and seeing how the curve behaves. It is not vessel data, not a hidden example from some real boat, and not something to copy into a deviation record.

All eight headings are required. If a field is empty or contains something that is not a valid number, the calculator will show an error instead of producing a curve.

What the calculator returns

After calculation, the tool shows three things:

  • the A/B/C/D/E coefficients;
  • a visual deviation curve;
  • a table with entered deviation, model value, and residual error.

The calculation uses the standard five-coefficient form:

Deviation = A + B sin θ + C cos θ + D sin 2θ + E cos 2θ

Here, θ is the compass heading. This is a compact way to describe the whole deviation curve instead of treating every heading as a separate little island.

The coefficient cards summarize the curve:

  • A is the average or constant part of the deviation.
  • B and C describe semicircular components.
  • D and E describe quadrantal components.

A coefficient is not the correction for one specific heading. The value for any heading comes from the full expression, with all five coefficients working together.

How to read the curve

The curve shows the entered deviation values around the compass. The horizontal axis moves through the headings from N to NW. The vertical axis shows deviation in degrees.

The dashed zero line is where the compass has no deviation for that heading. Points above the line are positive. Points below the line are negative.

The Range label shows the lowest and highest entered deviation in the current set. It is a quick way to see the spread before digging into the table.

The curve is useful because it lets you see the pattern. A smooth shape usually means the readings behave like they belong together. A sharp jump, strange kink, or one point that feels out of place may be a hint to check the original reading again.

How to read the table

The table is the most practical part of the output.

  • Heading is the compass heading label: N, NE, E, SE, S, SW, W, or NW.
  • Course is the same heading expressed in degrees.
  • Deviation is the value you entered.
  • Model is the value predicted by the curve for that heading.
  • Residual is the difference between the entered value and the model value.

The table is not a replacement for a formal deviation card. Think of it as a working record: a clearer way to compare your observed readings with the curve produced from them.

What the residual tells you

The residual is the difference between the observed value and the value predicted by the model.

Small residuals usually mean the curve follows the readings well. Larger residuals can point to a reading that deserves another look, a recording mistake, or a compass environment that is not behaving cleanly.

For example, if the observed deviation on one heading is 1.60° and the model gives 1.54°, the residual is 0.06°. That is small. If one heading has a much larger residual than the rest, that heading is worth checking.

Residuals are not pass/fail values. They are a sanity check. They help answer a very practical question: do these readings look like they belong to the same believable curve?

What this tool does not do

This part matters, because a calculator can look more official than it really is.

The tool does not measure deviation by itself. It only calculates from values you enter.

It also does not:

  • correct the compass;
  • decide whether a vessel is compliant;
  • include magnetic variation from a chart or geomagnetic model;
  • convert compass, magnetic, and true headings for navigation;
  • replace a licensed compass adjuster, official deviation card, or required onboard record.

Use it as a calculation and review aid. Not as a certificate, not as a professional adjustment, and not as permission to ignore the rules that apply to a real vessel.

When a new compass swing may be needed

A compass swing or deviation check may be needed after changes that affect the vessel’s magnetic environment. Common examples include:

  • installation or relocation of electronics;
  • structural changes or steel work;
  • new speakers, batteries, wiring, or chargers;
  • cargo or equipment placed near the compass;
  • compass replacement or relocation;
  • unexplained disagreement between the compass and reliable references.

The exact requirements depend on vessel type, flag, operation, and local rules. The calculator does not decide compliance. It only helps turn readings into something easier to inspect.

Practical limits

This tool is useful for understanding and checking a deviation curve, but it cannot rescue bad input readings.

Bad headings, unstable references, poor steering during the swing, nearby magnetic objects, or simple recording mistakes can all produce misleading results. The curve may still look tidy, because calculators are very polite like that. It does not mean the underlying readings are good.

So use the output as a working calculation and review aid. For official work, professional compass adjustment, deviation cards, onboard records, and vessel-specific requirements still matter.

References

A few references behind the terms and calculation:

  • NOAA explains magnetic declination, also called variation, as the angle between magnetic north and true north.
  • Bowditch, The American Practical Navigator, describes the five-coefficient deviation expression used to model a magnetic compass deviation curve.
  • AMSA publishes a standard/steering compass deviation table form and notes that deviation tables and compass deviation books may be required in regulated vessel contexts.

Reference links:

Start with the tool

If you already have readings, go straight to the calculator:

Open the Deviation Calculator