GSTIN Format: What All 15 Characters Mean
Every character of the GSTIN format decoded — state code, PAN, entity code, checksum — with a regex, worked example and 20 free credits.
A GSTIN is a 15-character code, and every one of those characters carries a specific meaning: a two-digit state code, a full 10-character PAN, a registration counter, a reserved character, and a checksum. None of it is decorative — once you know the GSTIN format, you can read a business's home state, its PAN, and its entity type straight off the string, before any API call.
The format of a GSTIN, character by character
In one line, the format of a GSTIN is: 2 digits + 10-character PAN + 1 entity code + the letter
Z + 1 checksum character. Take a real, active GSTIN — 27AAACR5055K1Z7, registered
to Reliance Industries Limited in Maharashtra — and break it into those five components.
| Position | Value | Meaning |
|---|---|---|
| 1–2 | 27 | State code — Maharashtra |
| 3–12 | AAACR5055K | PAN of the registered entity |
| 13 | 1 | First GST registration for this PAN in this state |
| 14 | Z | Reserved, always Z |
| 15 | 7 | Checksum over the first 14 characters |
That structure is fixed across every GSTIN issued anywhere in India, which is what makes it possible to validate one offline before ever calling an API.
The GSTIN format as a regular expression
Each position has a fixed character class, so the whole format compresses into one expression. This is the shape to validate against before you spend a lookup on a string a user typed:
^[0-9]{2}[A-Z]{5}[0-9]{4}[A-Z]{1}[1-9A-Z]{1}Z[0-9A-Z]{1}$
| Pattern | Positions | Why that character class |
|---|---|---|
[0-9]{2} | 1–2 | State codes are numeric throughout |
[A-Z]{5} | 3–7 | The PAN always opens with five letters |
[0-9]{4} | 8–11 | The PAN's four numeric characters |
[A-Z]{1} | 12 | The PAN's own trailing check letter |
[1-9A-Z]{1} | 13 | The registration counter runs 1–9 then A–Z; it is never 0 |
Z | 14 | Fixed under the current scheme |
[0-9A-Z]{1} | 15 | The checksum can land on any character in the 36-character set |
Characters 1–2: the state code
The first two characters are the GST state code of the jurisdiction where the entity registered — 27 for Maharashtra, 07 for Delhi, 33 for Tamil Nadu, and so on through the full list. This code is also what determines whether a supply attracts CGST plus SGST (both parties in the same state) or IGST (an inter-state supply). We cover the complete, current table — including the Daman & Diu merger and the Andhra Pradesh bifurcation — in the GST state code list.
Characters 3–12: the embedded PAN
Characters 3 through 12 are, character for character, the entity's 10-character Income Tax PAN. This is the single most useful fact about the GSTIN format: a business's GSTIN literally contains its PAN, which is why a PAN is a mandatory prerequisite for GST registration and why the two identifiers are so frequently confused. We cover that relationship — and the reverse question of how one PAN can carry several GSTINs — in GST number vs PAN: the key differences.
The 4th character of the PAN (the 6th character of the full GSTIN) is not random — it identifies the category of PAN holder. The table below covers the values you will actually encounter.
| Character | Entity type |
|---|---|
| C | Company |
| P | Individual / proprietor |
| F | Firm or Limited Liability Partnership |
| H | Hindu Undivided Family (HUF) |
| A | Association of Persons (AOP) |
| B | Body of Individuals (BOI) |
| G | Government |
| J | Artificial Juridical Person |
| L | Local Authority |
| T | Trust |
In 27AAACR5055K1Z7, that character is C — Reliance Industries is registered as
a company, which is exactly what you would expect.
Character 13: registrations per PAN per state
A single PAN is allowed more than one GST registration inside the same state — commonly for distinct business verticals under Section 25 rules. Character 13 is the counter that tells them apart: it runs 1 through 9 first, and if a PAN somehow needs more than nine registrations in one state, it continues A through Z. In practice almost every GSTIN you will see carries a 1 here, meaning it is the only registration that PAN holds in that state.
Character 14: the reserved "Z"
Character 14 is fixed at Z for every GSTIN issued under the current scheme. It is reserved
for a future use that has not yet been defined by GSTN. If you ever see a supposed GSTIN where this
position is not Z, treat it as a red flag rather than a formatting quirk.
Character 15: the checksum, and how to compute it
The final character is a check digit computed from the first 14 using a Luhn mod-36 algorithm — the same family of algorithm used to validate credit card numbers, adapted to a 36-character alphanumeric set instead of plain decimal digits. Here is the exact, verified procedure.
Charset (a character's value is its position, starting at 0):
0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ
Over the first 14 characters, left to right, for position i starting at 0:
- Look up
value= the character's index in the charset above. factor= 1 wheniis even, 2 wheniis odd.product=value * factor.- Add
floor(product / 36) + (product mod 36)to a running sum. - After all 14 characters, the check character =
charset[(36 - (sum mod 36)) mod 36].
Here is a short reference implementation in both JavaScript and Python.
// JavaScript
const CHARSET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ';
function gstinCheckDigit(first14) {
let sum = 0;
for (let i = 0; i < 14; i++) {
const value = CHARSET.indexOf(first14[i]);
const factor = i % 2 === 0 ? 1 : 2;
const product = value * factor;
sum += Math.floor(product / 36) + (product % 36);
}
return CHARSET[(36 - (sum % 36)) % 36];
}
# Python
CHARSET = '0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ'
def gstin_check_digit(first_14: str) -> str:
total = 0
for i, ch in enumerate(first_14):
value = CHARSET.index(ch)
factor = 1 if i % 2 == 0 else 2
product = value * factor
total += product // 36 + product % 36
return CHARSET[(36 - (total % 36)) % 36]
Why a valid format is not the same as a real business
This is the point worth repeating: the checksum in position 15 only proves the string is internally consistent. It says nothing about whether that GSTIN was ever allocated by a tax officer, whether the business behind it still exists, or whether its registration is currently active. Because the checksum algorithm is public and mechanical, it is trivial to generate a string that passes format and checksum validation without corresponding to any real taxpayer. That gap — well-formed versus real and active — is exactly what a live lookup like our GST verification API closes, by checking the number against the government's actual taxpayer record rather than just its shape. If you want to see this distinction in action, our guide to spotting a fake GST number covers the checks that go beyond checksum alone.
For a shorter, more direct answer to "how long is a GST number", see how many digits are in a GST number. And if a GSTIN you are checking comes back with a status other than Active, read what a suspended GSTIN status actually means before you act on it.
Frequently asked questions
A note on accuracy. GST rules change often. This article reflects our understanding as of 14 October 2026 and is general information, not tax or legal advice. For the authoritative position, check gst.gov.in and cbic-gst.gov.in, or speak to a qualified tax professional about your specific situation.
Check a GSTIN right now, free
Five lookups a day, no account required. Status, filing history, e-invoicing and jurisdiction.
Free GST search toolBuild it into your product
One REST call, JSON back. Get an API key and 20 free verification credits in under a minute.
Start freeMore on gst rules & compliance
Browse every guide in the GST API blog.