Skip to main content
Skip to main content

India GSTIN Validator

Validate India Goods and Services Tax Identification Numbers (GSTIN). QA.

How GSTIN validation works

The validator checks if the input is exactly 15 characters and matches the official regex template. It verifies that the first two digits represent a valid state code, and parses the taxpayer's PAN.

It applies the alternating Modulo 36 algorithm across the first 14 characters with alternating weights [1, 2, 1, 2...] and checks if it matches the 15th digit.

Anatomy & Structure of the GSTIN (Goods and Services Tax Number)

The Indian GSTIN consists of 15 alphanumeric characters structured in 5 parts:

PositionFieldLengthMeaning & RuleExample
1 & 2State Code2 digitsOfficial state/territory code (01 to 37 per Indian Census)27
3 to 12Entity PAN10 charsPermanent Account Number of the entity (format AAAAA9999A)AAPFU0939F
13Entity Registration Count1 charNumber of registrations in the same state (1-9, A-Z)1
14Default Character1 charFixed character 'Z' by GSTN regulationsZ
15Check Character1 charCalculated via alternating Modulo 36 algorithm5

Official Algorithm (Alternating Modulo 36 — GSTN)

GSTIN uses alternating Modulo 36 with weights [1, 2, 1, 2...]:

factor = val * (pos%2 === 0 ? 1 : 2); sum += floor(factor/36) + (factor%36); Check = (36 - (sum%36))%36
  1. 1. Map each character to value 0-35 (0-9=0-9, A-Z=10-35).
  2. 2. Use weight 1 for even positions and weight 2 for odd positions.
  3. 3. Multiply character value by weight: factor = val × weight.
  4. 4. Add to sum: floor(factor / 36) + (factor % 36).
  5. 5. Take remainder modulo 36 and map to final check character.

Frequently Asked Questions