Explainer 10 min read

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.

Written and reviewed by the GSTIN API team Last reviewed

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.

PositionValueMeaning
1–227State code — Maharashtra
3–12AAACR5055KPAN of the registered entity
131First GST registration for this PAN in this state
14ZReserved, always Z
157Checksum over the first 14 characters
Structure of 27AAACR5055K1Z7.

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}$
PatternPositionsWhy that character class
[0-9]{2}1–2State codes are numeric throughout
[A-Z]{5}3–7The PAN always opens with five letters
[0-9]{4}8–11The PAN's four numeric characters
[A-Z]{1}12The PAN's own trailing check letter
[1-9A-Z]{1}13The registration counter runs 1–9 then A–Z; it is never 0
Z14Fixed under the current scheme
[0-9A-Z]{1}15The checksum can land on any character in the 36-character set
How the regular expression maps onto the GSTIN format.

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.

CharacterEntity type
CCompany
PIndividual / proprietor
FFirm or Limited Liability Partnership
HHindu Undivided Family (HUF)
AAssociation of Persons (AOP)
BBody of Individuals (BOI)
GGovernment
JArtificial Juridical Person
LLocal Authority
TTrust
PAN holder-type codes, as embedded in the GSTIN.

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:

  1. Look up value = the character's index in the charset above.
  2. factor = 1 when i is even, 2 when i is odd.
  3. product = value * factor.
  4. Add floor(product / 36) + (product mod 36) to a running sum.
  5. 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

Exactly 15. It is alphanumeric, not purely numeric, so calling it a "15-digit number" is a common but technically loose shorthand.
15. Every GSTIN has 15 alphanumeric characters: a 2-digit state code, the 10-character PAN (5 letters, 4 digits, 1 letter), a 1-character entity number, the letter Z, and a 1-character check code. Some positions are always digits and some always letters, but the GSTIN as a whole is a 15-character alphanumeric code.
The 4th character of a GSTIN is also the 4th character of the embedded PAN, and it identifies the type of taxpayer entity — for example C for company, P for an individual proprietor, F for a firm or LLP, or H for a Hindu Undivided Family.
Yes. A single PAN can hold one GSTIN per state it operates in, and in some cases more than one within the same state for separate business verticals. The 13th character of the GSTIN is what distinguishes those multiple registrations against the same PAN.
No. A correct checksum only proves the number is mathematically well-formed — it does not prove the GSTIN was ever issued by the GST department. Anyone can generate a checksum-valid string. Confirming a GSTIN actually exists and is active requires a live lookup against government records.
It is reserved for future use under the current GSTIN scheme and is fixed at "Z" for every GSTIN issued so far. A GSTIN where this character is not Z should be treated as non-standard.

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 tool

Build it into your product

One REST call, JSON back. Get an API key and 20 free verification credits in under a minute.

Start free