Developer Reference 3 min read

Understanding the Indian GSTIN Modulo-36 Checksum Algorithm (Developer Reference)

Structure of a 15-Digit Indian GSTIN

Every GST identification number in India conforms to the following 15-character pattern:

[State Code: 2 Digits][PAN: 10 Chars][Entity Number: 1 Char][Default 'Z'][Checksum: 1 Char]
Example: 27 AABCS 1429B 1 Z 6

The Modulo-36 Calculation Logic

The 15th character is a mathematically calculated check-digit derived using a base-36 character set (0-9 followed by A-Z):

  1. Assign code points 0 through 35 to characters 0-9A-Z.
  2. Traverse the first 14 characters, alternating weight factors of 1 and 2.
  3. Multiply the code point by the factor, add the quotient and remainder divided by 36.
  4. Calculate the modulo-36 remainder and derive the expected 15th check character.

EntryFlow validates this locally in sub-millisecond time on every incoming invoice before running LLM extraction, eliminating invalid vendors before they enter your accounting system.

Ready to automate your Tally Prime vouchers?

Upload an invoice PDF now and download verified Tally XML in 3 seconds.

Test on Live Demo →