snaptxt.app
Blog
Validators4 min readNovember 3, 2026

What Makes a GSTIN Valid (And How to Test One)

Building anything that invoices or registers Indian businesses means handling a GSTIN — the Goods and Services Tax Identification Number — and testing that field needs a GSTIN that validates but isn't a real company's registration. Here's how a GSTIN is structured and how to generate dummy ones for QA.

A GSTIN packs four things into 15 characters

Unlike a plain numeric ID, a GSTIN is a structured 15-character string that encodes real meaning:

  • Characters 1–2 — the state code (a two-digit number, e.g. 27 for Maharashtra, 29 for Karnataka, 07 for Delhi).
  • Characters 3–12 — the entity's 10-character PAN (same AAAAA0000A format as an individual PAN).
  • Character 13 — an entity/registration number for that PAN within the state.
  • Character 14 — the letter Z (reserved, fixed by default).
  • Character 15 — a checksum character.

That last character is computed over the first 14 using a Luhn-like mod-36 algorithm (digits 0–9 plus letters A–Z form the 36-symbol alphabet), with alternating weights. A GSTIN whose final character doesn't match that computation is invalid — and because it also embeds a valid state code and a valid PAN, a GSTIN is one of the harder identifiers to fake by hand.

Why random strings don't work

Three things have to line up: a recognised state code, a structurally valid PAN in the middle, and a correct mod-36 check character at the end. Miss any one and a proper validator rejects it. A generator handles all three — it picks a real state code, builds a valid PAN segment, sets the entity digit and the Z, then computes the checksum so the whole thing passes.

Valid format is not GST registration

A generated GSTIN clears the structural and checksum checks. It is not a registered GST number, and it confers no tax status. Use it for form validation, QA, demos, and dev databases only — submitting a fabricated GSTIN on a real invoice or filing is not testing. Whether a GSTIN is actually registered is a live lookup against the GST portal, separate from format validation.

Try it

The Indian GSTIN Validator checks a GSTIN's state code, embedded PAN, and mod-36 checksum, all in your browser with nothing sent to a server. Since a GSTIN contains a PAN, the PAN generator & validator is a useful companion — and for a deeper look at the PAN format, see how to validate an Indian PAN card number.

guideindiadummy-datatesting
H

Hanuman Singh · built snaptxt.app · hanumansingh.dev