The number on every Indian invoice
Since 2017, the GSTIN — Goods and Services Tax Identification Number — has appeared on Indian tax invoices, registration certificates, and vendor records. It looks like a random 15-character jumble: 27AAPFU0939F1ZV. It isn’t random at all. Every position carries meaning, and the last character is a mathematical check digit that lets you catch most typos instantly. This guide walks through the structure piece by piece, and the GST Number Validator lets you decode any GSTIN as you read.
The 15 characters, decoded
A GSTIN is always exactly 15 characters, broken into five parts:
- State code (characters 1–2) — two digits identifying the state or union territory of registration.
- PAN (characters 3–12) — the 10-character Permanent Account Number of the business.
- Entity number (character 13) — how many registrations this PAN holds in that state.
- Default letter (character 14) — currently always ‘Z’.
- Checksum (character 15) — a single check character derived from the first 14.
Take 27AAPFU0939F1ZV: state code 27 (Maharashtra), PAN AAPFU0939F, entity number 1, the default Z, and checksum V. The GST Number Validator extracts each of these automatically.
State codes
The first two digits map to the official GST state-code list. A few common ones: 07 is Delhi, 09 is Uttar Pradesh, 24 is Gujarat, 27 is Maharashtra, 29 is Karnataka, 33 is Tamil Nadu, and 36 is Telangana. The codes run from 01 (Jammu & Kashmir) upward, with a couple of special codes like 97 for “Other Territory”. A GSTIN whose first two digits aren’t on the list can’t be genuine, which is the first thing a validator checks.
The embedded PAN
Characters 3 through 12 are the holder’s PAN, and the PAN itself has structure: five letters, four digits, then one letter. The fourth character of the PAN — the sixth character of the GSTIN overall — reveals the type of taxpayer:
P— individual or proprietorC— companyF— firm or LLPH— Hindu Undivided Family (HUF)T— trustA— association of personsG— government
In AAPFU0939F, the fourth letter is F, so this is a firm or LLP. That single character tells you a lot about who you’re dealing with, and the validator surfaces it for you.
The entity number
The 13th character counts registrations for that PAN within the state. The first registration gets 1, the second 2, and so on; after 9 it continues with letters. This is how one business group legitimately holds several GSTINs under the same PAN — one per state, plus additional ones for separate verticals within a state.
The checksum: how typos get caught
The final character is where the real validation power lives. It’s computed from the first 14 characters using a base-36 (mod 36) algorithm — a cousin of the Luhn check used on credit cards. In outline:
- Map every character to a code point over
0-9thenA-Z, so digits are 0–9 and letters are 10–35. - Working right to left, multiply each code point by an alternating weight of 1 and 2.
- Fold each product as
floor(value / 36) + (value % 36)and add it to a running sum. - The check digit is
(36 − sum % 36) % 36, mapped back to a character.
If even one character is mistyped, the recomputed check digit almost always disagrees with the printed one, so the number is rejected. The GST Number Validator runs this exact calculation in your browser and shows both the expected and the found check character when they differ.
What validation can and cannot tell you
Format and checksum validation is fast and catches the overwhelming majority of mistakes: wrong length, an impossible state code, a transposed digit, a dropped character. What it cannot do is confirm that a GSTIN was actually issued or is currently active. A number can be perfectly well-formed and still belong to no one. That’s an important limit: treat a “valid” result as “this could be a real GSTIN”, not “this is a registered business”. For anything with legal or financial weight, verify on the official GST portal.
A practical checklist
Before you record a supplier’s GSTIN, run through this:
- Is it exactly 15 characters with no stray spaces?
- Do the first two digits match a real state code — ideally the supplier’s stated state?
- Does the embedded PAN’s type character match the kind of business you expect?
- Does the checksum pass?
The validator does all four in one go, which is far quicker than eyeballing it. Catching a bad GSTIN at data-entry time saves you from input-tax-credit problems later, when fixing it means amending filings.
A worked example
Walk through 27AAPFU0939F1ZV end to end. The first two characters, 27, are a valid state code — Maharashtra. Characters 3–12, AAPFU0939F, form a PAN: five letters, four digits, a final letter, so the structure is right. The fourth letter of that PAN is F, marking a firm or LLP. The 13th character, 1, says this is the first registration for that PAN in Maharashtra. The 14th is the default Z. Finally, the checksum routine runs over the first 14 characters and produces V, which matches the printed 15th character — so the number is internally consistent. Change any single character and the recomputed checksum almost always stops matching, which is how the GST Number Validator flags a typo immediately.
Where invalid GSTINs come from
Most bad GSTINs aren’t fraud — they’re honest mistakes. Someone transposes two digits while copying from a paper invoice, drops a character during a phone call, or pastes a number with a trailing space. Optical character recognition from scanned documents is another common source, mixing up visually similar characters like 0 and O or 1 and I. Because the checksum was designed to catch exactly these single-character and transposition errors, a quick validation pass turns a silent data-entry slip into an immediate, fixable flag — long before it reaches a GST return where corrections are painful.
Where to go next
If you work with Indian financial data a lot, you may also like turning amounts into words for cheques and invoices — see the currency-words guide. And whenever you need to sanity-check a GSTIN, the GST Number Validator is one paste away.