NMEA checksum calculator
Paste one or more NMEA 0183 sentences, one per line. For each you see the correct checksum, whether the transmitted one matches, and the corrected sentence.
One sentence per line, with or without *checksum. Sentences may start with $ or ! (AIS).
Runs entirely in your browser — nothing you enter is sent anywhere.
How the NMEA checksum works
The checksum is a simple XOR over every character between the leading $ (or !) and the *. Neither of those two characters is included, and neither is the line ending.
- Start with 0 and XOR the ASCII code of each character after $ in turn.
- Stop at the * — it ends the covered range.
- Write the result as two uppercase hex digits after the *: GGA … ,M,,*47.
The same in C
A few lines are enough. Compare the result with the two hex digits after the * before you trust the fields.
/* XOR from after '$' up to '*' */ uint8_t nmea_checksum(const char *sentence) { uint8_t sum = 0; for (const char *p = sentence + 1; *p && *p != '*'; p++) sum ^= (uint8_t)*p; return sum; /* print as "%02X" after the '*' */ }
Frequently asked questions
Which characters count towards the checksum?
Everything strictly between $ (or !) and * — talker and sentence ID, every comma and every field. The $, the * and the CR LF at the end are not included.
Is the checksum mandatory?
Practically yes: current receivers send it with every sentence, and many parsers reject sentences without it. Older NMEA versions allowed it to be omitted for some sentences, which is why this tool also handles lines without one.
Does the same checksum apply to AIS (!AIVDM)?
Yes. AIS sentences start with ! instead of $ but use the same XOR checksum over the characters up to the *.
More than one sentence to check?
Trace reads the serial line of a GPS receiver or chartplotter, verifies the checksum of every $ sentence and shows talker and sentence type — live and searchable.