Blog · Guide

MMSI vs IMO number: which vessel identifier to use

5 min read

What MMSI and IMO numbers are, how they differ, when each one changes, how to validate an IMO number, and which one to store in your database.

Every vessel data integration runs into the same question within the first hour: should I identify ships by MMSI or by IMO number? Both are numbers, both appear in AIS messages, and both are accepted by most vessel APIs. They are not interchangeable, though, and picking the wrong one as your primary key causes subtle bugs months later. This article explains what each number is, when it changes, and how to use both.

The short answer

  • The MMSI identifies a radio station: the AIS transponder (and the ship's other radio equipment) currently on board. It is what every AIS message carries, so it is the natural key for live tracking.
  • The IMO number identifies the hull. It is assigned once and stays with the ship for life, through every change of name, flag and owner. It is the right key for anything long-lived: contracts, compliance, sanctions screening, history across years.

Most systems store both, look vessels up by either, and use the IMO number to link records over time when it exists.

MMSI: the radio identity

A Maritime Mobile Service Identity is a 9-digit number assigned by the flag state's telecommunications administration. For ships, the first three digits are the MID (Maritime Identification Digits), which identify the country that issued it: 211 and 218 are Germany, 244 to 246 the Netherlands, 538 the Marshall Islands, 636 and 637 Liberia, and so on. That is why the MMSI is a quick way to tell a vessel's flag.

Not every MMSI belongs to a ship. The format encodes the kind of station:

Pattern Station
MIDxxxxxx a ship
00MIDxxxx a coast station
111MIDxxx a search-and-rescue aircraft
99MIDxxxx an aid to navigation (a buoy, a lighthouse)
970xxxxxx an AIS search-and-rescue transmitter
972xxxxxx a man-overboard device
974xxxxxx an emergency position-indicating beacon

When a ship changes flag, it gets a new MMSI from the new flag state. It can also change when the radio licence changes. So the same hull can appear under several MMSIs over its life, and, less often, an MMSI that was freed up can later be assigned to a different ship.

MMSIs also go wrong in practice. Transponders are sometimes installed with a default number (a MID followed by zeros, or 123456789), and that number then shows up for many unrelated vessels. A careful data pipeline filters those out rather than merging different ships into one.

IMO number: the hull identity

The IMO ship identification number was introduced by the International Maritime Organization in 1987 and made mandatory under SOLAS chapter XI-1 for passenger ships of 100 gross tonnage and above and cargo ships of 300 gross tonnage and above. It is written as IMO followed by seven digits, for example IMO 9074729.

The number is assigned when the ship is built (or registered for the first time) and never reused. A ship renamed four times and reflagged three times keeps the same IMO number throughout. That stability is exactly why sanctions lists, port state control databases, insurers and classification societies all record it.

Many vessels have no IMO number at all: most fishing boats, pleasure craft, tugs, inland barges and small domestic craft fall below the thresholds. In AIS, the IMO field is often empty for those vessels, or filled with something that is not a valid IMO number.

Validating an IMO number

The seventh digit is a check digit, so you can catch most typing errors and junk values without any lookup. Multiply each of the first six digits by a weight from 7 down to 2, add the products, and take the last digit of the sum. It must equal the seventh digit.

For IMO 9074729:

9×7 + 0×6 + 7×5 + 4×4 + 7×3 + 2×2 = 63 + 0 + 35 + 16 + 21 + 4 = 139
last digit of 139 = 9  →  check digit 9  ✓

In code:

def valid_imo(value: str) -> bool:
    digits = value.removeprefix("IMO").strip()
    if len(digits) != 7 or not digits.isdigit():
        return False
    total = sum(int(d) * w for d, w in zip(digits[:6], range(7, 1, -1)))
    return total % 10 == int(digits[6])

We apply the same rule on our side: an IMO number that fails the check digit is dropped rather than published, so the imo field of the vessel particulars API is either a valid number or null.

Which one to use, case by case

Live tracking and maps. Use the MMSI. It is in every AIS position report, so it is how positions are keyed in the first place. Our vessel location API accepts either number on the same route, which means you can store the IMO number and still ask for the live position.

Fleet lists and watchlists. Store both. Add vessels by IMO when you have it (it survives a change of flag), and keep the MMSI the API returns so you notice when it changes.

Compliance and sanctions. Use the IMO number. Sanctions lists name vessels by IMO precisely because names and MMSIs change, often deliberately, when a ship is trying to hide. See sanctions screening by IMO number and the vessel sanctions API.

History over years. Link records by IMO number. An MMSI-based history breaks at every reflagging.

Small craft. Use the MMSI, because there is usually no IMO number.

Names are not identifiers

It is tempting to match vessels by name, especially when importing a spreadsheet. Do not. Names are not unique (there are many ships with the same popular names), they are written inconsistently in AIS (punctuation, prefixes such as "M/V", truncation to 20 characters), and they change with owners. Use the name to search, then confirm the vessel by MMSI or IMO number.

Putting it into practice

A robust vessel table usually looks like this:

Column Notes
imo nullable; validated with the check digit; the long-term key when present
mmsi the current radio identity; updated when it changes
name for display and search only
first_seen, last_seen so you can tell a fresh record from an abandoned one

When you query an API, both identifiers work on our vessel routes: a 9-digit value is read as an MMSI and a 7-digit value as an IMO number.

curl -H "X-API-Key: $WINGO_KEY" "https://wingo-marine.com/api/public/v1/vessels/9074729"

The answer carries both numbers when the vessel has them, plus its call sign, type and dimensions. The API reference lists every field.

MMSIIMOidentifiersbasics

More from the blog

Try it on your own vessels

Free account, no card, an API key in a minute.

Get a free API key