NMEA 0183 decoder and checksum tool

NMEA 0183 Decoder and Checksum Calculator (Online Tool)

NMEA 0183 is the plain-text language spoken by GPS receivers, chartplotters, depth sounders, wind instruments and autopilots. Each line, or “sentence”, packs time, position, speed, depth or wind data into comma-separated fields that end with a checksum. Paste a sentence below and the tool splits it into fields, explains what each field means and verifies the checksum, so you can debug a GPS module or marine network in seconds.

Anatomy of an NMEA 0183 sentence

$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47
│└┬┘└┬┘ └────────────── data fields ──────────────────────┘ └┬┘
│ │  └ sentence type (GGA)                                    └ checksum
│ └ talker ID (GP = GPS)
└ start character ($, or ! for AIS)
  • Start character: $ for normal sentences, ! for encapsulated data such as AIS.
  • Talker ID: Two letters for the source device: GP (GPS), GN (multi-GNSS), GL (GLONASS), GA (Galileo), GB (BeiDou), SD (depth sounder), WI (wind instrument), HC (magnetic compass) and so on.
  • Sentence type: Three letters that define the data layout: RMC, GGA, VTG, DBT, MWV…
  • Fields: Comma-separated values. An empty field (two commas in a row) means the value is not available.
  • Checksum: An asterisk followed by two hexadecimal digits.
  • End: Each sentence ends with carriage return and line feed () and is at most 82 characters long.

How the checksum is calculated

The checksum is the XOR of every character between $ (or !) and *, written as two hexadecimal digits. It lets the receiver detect corrupted sentences.

def nmea_checksum(sentence):
    body = sentence.strip().lstrip('$!').split('*')[0]
    cs = 0
    for ch in body:
        cs ^= ord(ch)
    return f"{cs:02X}"

print(nmea_checksum("$GPGGA,123519,4807.038,N,01131.000,E,1,08,0.9,545.4,M,46.9,M,,*47"))  # 47

If the calculated value differs from the one after the asterisk, the sentence was corrupted in transmission (noise, baud rate mismatch, a missing character) and should be discarded.

Common sentence types

SentenceMeaningKey data
RMCRecommended minimum GNSS dataTime, status, position, speed, course, date
GGAGPS fix dataTime, position, fix quality, satellites, HDOP, altitude
GLLGeographic positionLatitude, longitude, time, status
VTGTrack made good and ground speedCourse and speed in knots and km/h
GSADOP and active satellitesFix type, satellites used, PDOP/HDOP/VDOP
GSVSatellites in viewSatellite IDs, elevation, azimuth, SNR
DBT / DPTDepth below transducer / depth of waterDepth in feet, metres, fathoms
MWVWind speed and angleRelative or true wind
HDT / HDMTrue / magnetic headingHeading in degrees
ZDATime and dateUTC time, day, month, year, local zone

Reading latitude and longitude in NMEA

Positions use degrees and decimal minutes, not decimal degrees:

  • 4807.038,N → 48° 07.038′ N → 48 + 7.038/60 = 48.1173°
  • 01131.000,E → 11° 31.000′ E → 11 + 31/60 = 11.5167°

Latitude uses two digits for degrees (ddmm.mmm) and longitude uses three (dddmm.mmm). South and west become negative in decimal degrees. Convert other formats with the coordinate converter.

GGA fix quality values

ValueMeaning
0No fix
1GPS fix (standard)
2DGPS / SBAS fix
4RTK fixed (centimetre-level)
5RTK float
6Dead reckoning (estimated)

Troubleshooting with the decoder

  • Garbled text: Usually a baud rate mismatch. Most GPS modules default to 9600 baud; marine NMEA 0183 is typically 4800 baud (38400 for high-speed AIS).
  • Checksum errors: Electrical noise, long unshielded cables or a ground problem. Check wiring and grounding.
  • Status V or fix quality 0: The receiver has no valid fix yet. Give it a clear view of the sky and time for a cold start.
  • Empty fields: The device doesn’t provide that value, or doesn’t have it yet.

For a deeper look at the protocol, electrical interface (RS-422) and parsing in Python, read our NMEA 0183 protocol guide. Newer boats use the CAN-based NMEA 2000 network instead.

Frequently asked questions

Is the checksum mandatory?

It is optional in some older sentence types, but almost all modern devices send it, and you should always verify it in your own parser.

Why does my sentence have an empty field before the checksum?

Empty fields are normal; they mean the value is not available. In GGA, the last two fields (DGPS age and station ID) are usually empty unless you use differential corrections.

Can I use the decoder for AIS messages?

AIS sentences (!AIVDM) start with “!” and the checksum check works, but the payload is a 6-bit encoded binary message that needs a dedicated AIS decoder.

Found this useful?Share it with a friend or follow us on Instagram for new projects.

Similar Posts