Curious Minds

Clear answers to science and history questions

Valid GSTIN for Testing: Format, Check Digit & Examples

· 6 min read · Science

A valid GSTIN for testing is any 15-character code that passes the official checksum, not a real taxpayer's number.

A valid GSTIN for testing is a 15-character code that follows the standard format and passes the check-digit calculation. You can build one yourself using a state code, a dummy PAN, an entity number and the correct checksum. The number does not need to belong to a real business, but it must pass the same validation rules as a live GSTIN.

The detail most people get wrong: the last character is not random. It is a check digit calculated from the first 14 characters. If you make up the last character, the number will fail validation even if the rest looks right.

What the 15 Characters of a GSTIN Mean

A GSTIN (Goods and Services Tax Identification Number) is issued by the GST Network to registered taxpayers. Every character has a fixed meaning. The structure is the same for all taxpayers, which is why a test number can be built from scratch.

PositionWhat it holdsExample
1–2State code (two digits)27 for Maharashtra
3–12PAN of the business or personABCDE1234F
13Entity number (1–9, then A–Z for branches)1
14Alphabet 'Z' by defaultZ
15Check digit (0–9 or A–Z)5

The state code must be one of the codes assigned to Indian states and union territories. The PAN portion must follow the PAN format: five letters, four digits, one letter. The entity number starts at 1 for the first registration in a state and goes up for additional registrations. The 14th character is 'Z' unless the GSTN has assigned something else.

How the Check Digit Is Calculated

The check digit uses a simple algorithm based on the base-36 value of each character. Digits 0–9 have values 0–9. Letters A–Z have values 10–35. Each of the first 14 characters is multiplied by a weight that alternates between 1 and 2, starting with 1 for the first character. The products are summed, and the check digit is the value that brings the total to the next multiple of 36.

Here is the step-by-step method:

  1. Take the first 14 characters of your test GSTIN.
  2. Convert each character to its base-36 value (0–9 for digits, 10–35 for A–Z).
  3. Multiply the value at position 1 by 1, position 2 by 2, position 3 by 1, position 4 by 2, and so on.
  4. Add all 14 products together.
  5. Divide the sum by 36 and find the remainder.
  6. Subtract the remainder from 36. If the result is 36, the check digit is 0. Otherwise, convert the result back to a character (0–9 or A–Z).

This is the same checksum used by the GSTN portal and most accounting software. A test number that passes this calculation will be accepted by validation routines even if no real business is attached to it.

Worked Example: Building a Test GSTIN

Suppose you want a test GSTIN for Maharashtra (state code 27) with a dummy PAN of ABCDE1234F and entity number 1. The first 14 characters are:

2 7 A B C D E 1 2 3 4 F 1 Z

Convert each to its base-36 value:

  • 2 = 2, 7 = 7
  • A = 10, B = 11, C = 12, D = 13, E = 14
  • 1 = 1, 2 = 2, 3 = 3, 4 = 4
  • F = 15
  • 1 = 1
  • Z = 35

Now apply the weights (1, 2, 1, 2, …):

  • 2×1 = 2
  • 7×2 = 14
  • 10×1 = 10
  • 11×2 = 22
  • 12×1 = 12
  • 13×2 = 26
  • 14×1 = 14
  • 1×2 = 2
  • 2×1 = 2
  • 3×2 = 6
  • 4×1 = 4
  • 15×2 = 30
  • 1×1 = 1
  • 35×2 = 70

Sum = 2 + 14 + 10 + 22 + 12 + 26 + 14 + 2 + 2 + 6 + 4 + 30 + 1 + 70 = 215.

215 ÷ 36 = 5 remainder 35. 36 − 35 = 1. The check digit is 1.

So the full test GSTIN is 27ABCDE1234F1Z1. This number passes the checksum and can be used in test environments.

Where Test GSTINs Are Used and Where They Fail

Test GSTINs are used in sandbox environments of accounting software, e-invoicing portals, and GST return filing utilities. They let developers and testers check that validation, invoice generation, and data import work correctly without touching live taxpayer data.

A test GSTIN will fail in three common places:

  • Live GST portals: The GSTN portal checks the number against its registration database. A number that passes the checksum but is not registered will be rejected.
  • E-way bill generation: The e-way bill system validates the GSTIN against active registrations, not just the format.
  • Input tax credit matching: GSTR-2A and GSTR-2B matching requires the supplier's actual GSTIN. A test number will not match any filed return.

Use test GSTINs only in controlled environments where the validation is format-based. Never use them on a live invoice, a tax return, or any document sent to a customer.

How to Verify a GSTIN Before Using It

If you have a GSTIN and want to know whether it is structurally valid, run it through the checksum calculation above. If you want to know whether it is a real, active registration, use the GSTN's public search facility on the GST portal. That search shows the legal name, trade name, registration date, and status (active, cancelled, suspended) for a valid GSTIN.

For software testing, the checksum is enough. For any real transaction, the portal search is the only reliable check. A number can pass the checksum and still belong to a cancelled registration, so format validation alone does not confirm that a taxpayer is active.

Common Misunderstandings About Test GSTINs

Misunderstanding: any 15-character string works. The correct fact: the string must follow the state code list, the PAN format, the entity number rules, and the checksum. A random 15-character string will fail most validators.

Misunderstanding: a valid test GSTIN is a real taxpayer's number. The correct fact: a test GSTIN is a dummy that passes format checks. Using a real taxpayer's GSTIN in test data risks exposing their information and is not appropriate.

Misunderstanding: the check digit can be any letter or number. The correct fact: the check digit is determined by the first 14 characters. Change any of the first 14 and the check digit must be recalculated.

Questions people ask

Can I use a test GSTIN on an actual invoice?

No. An invoice with a test GSTIN is not a valid tax document. The buyer cannot claim input tax credit on it, and the seller is not identified for GST purposes. Use only the registered GSTIN of the actual supplier.

Does a GSTIN checksum work for all states?

Yes. The checksum algorithm is the same for every state code. The state code itself must be a valid two-digit code from the official list, but the calculation does not change by state.

What if my test GSTIN fails the checksum?

Recalculate the check digit from the first 14 characters. The most common error is using the wrong base-36 value for a letter or applying the weights in the wrong order. Start the weights at 1 for the first character and alternate.

Is the 14th character always Z?

For most registrations, yes. The GSTN uses 'Z' as the default. Some special cases may use a different character, but for test numbers, 'Z' is the standard choice.

In this article
  1. What the 15 Characters of a GSTIN Mean
  2. How the Check Digit Is Calculated
  3. Worked Example: Building a Test GSTIN
  4. Where Test GSTINs Are Used and Where They Fail
  5. How to Verify a GSTIN Before Using It
  6. Common Misunderstandings About Test GSTINs
  7. Questions people ask