AIS NMEA Payload Decoder
Decode AIS NMEA !AIVDM and !AIVDO sentences or raw AIS 6-bit armored payloads. Inspect message type, MMSI, repeat indicator, vessel position, speed over ground, course over ground, heading, timestamp and payload bits.
—
—
—
—
What Is an AIS NMEA Payload?
Automatic Identification System equipment commonly transports AIS messages inside NMEA sentences. Received vessel traffic is commonly represented by !AIVDM, while !AIVDO is commonly associated with information transmitted by the receiving vessel itself.
!AIVDM,1,1,,A,15Muq?P0000G?tRMD5MTDwvN0<0l,0*5C
Fields include:
Sentence type
Fragment count
Fragment number
Sequence ID
Radio channel
AIS payload
Fill bits
ChecksumAIS 6-bit Payload Encoding
The payload is an ASCII-armored representation of six-bit AIS data. Each payload character is converted into a value from 0 through 63 and then expanded into six binary bits.
Payload Character
↓
ASCII value
↓
AIS armoring conversion
↓
6-bit value
↓
Binary field streamAIS Message Header
Most AIS messages begin with a common header containing the message type, repeat indicator and MMSI.
| Bits | Length | Field |
|---|---|---|
| 0–5 | 6 | Message Type |
| 6–7 | 2 | Repeat Indicator |
| 8–37 | 30 | MMSI |
AIS Message Types 1, 2 and 3
AIS message types 1, 2 and 3 are Class A position reports. They can contain navigation status, rate of turn, speed over ground, position accuracy, longitude, latitude, course over ground, true heading and UTC second.
| Field | Bits |
|---|---|
| Message Type | 0–5 |
| MMSI | 8–37 |
| Navigation Status | 38–41 |
| Speed Over Ground | 50–59 |
| Longitude | 61–88 |
| Latitude | 89–115 |
| Course Over Ground | 116–127 |
| True Heading | 128–136 |
| UTC Second | 137–142 |
AIS Message Type 18
Message type 18 is a standard Class B position report. It contains fields such as MMSI, speed, position accuracy, longitude, latitude, course, heading and timestamp.
Type 18 Position Fields
SOG:
Bits 46–55
Longitude:
Bits 57–84
Latitude:
Bits 85–111
COG:
Bits 112–123
Heading:
Bits 124–132
Timestamp:
Bits 133–138How AIS Coordinates Are Decoded
AIS position reports commonly encode longitude and latitude as signed integers with a scale of 1/600000 degree.
Longitude =
Signed Longitude Field / 600000
Latitude =
Signed Latitude Field / 600000AIS Speed Over Ground
For common position-report messages, speed over ground is represented in tenths of a knot.
Raw SOG:
123
Speed:
123 / 10
= 12.3 knotsAIS Course Over Ground
Course over ground is normally represented in tenths of a degree.
Raw COG:
2745
Course:
2745 / 10
= 274.5°AIS MMSI
The Maritime Mobile Service Identity is a 30-bit field in the common AIS message header. It identifies the transmitting maritime station or vessel according to MMSI numbering conventions.
AIS NMEA Fragment Fields
| NMEA Field | Meaning |
|---|---|
| 1 | Total number of fragments |
| 2 | Current fragment number |
| 3 | Sequential message ID |
| 4 | AIS radio channel |
| 5 | Encoded AIS payload |
| 6 | Fill-bit count |
What Are AIS Fill Bits?
AIS armoring stores data in six-bit groups. When the underlying message does not end exactly on a six-bit boundary, unused bits are added at the end. The NMEA fill-bit field tells the decoder how many trailing bits must be removed.
AIS NMEA Checksum
The NMEA checksum is calculated by XORing the characters between the initial exclamation mark and the asterisk. The result is normally shown as a two-digit hexadecimal value after the asterisk.
!AIVDM,...*5C
↑ ↑
start checksum
Checksum =
XOR of characters between ! and *