How to Validate an Indian PAN Card Number (Or Generate a Dummy One for Testing)
Most "PAN validation" people do is just a length check — ten characters, done. That catches typos, not malformed numbers. A PAN (Permanent Account Number) has real structure baked into it: a taxpayer-type code embedded in the middle of the string that a naive length check will never catch. Here's what the format actually encodes, and the three checks that catch a bad PAN before it causes a rejected form.
The format: AAAAA0000A
Every valid PAN follows the same 10-character structure:
- First 5 characters — uppercase letters (A–Z)
- Next 4 characters — digits (0–9)
- Last character — an uppercase letter (a check character)
So ABCPD1234E is structurally valid; abcpd1234e (lowercase) or ABCPD123E (9 characters) is not.
What the 4th letter means
The fourth character of the first five isn't random — it encodes the type of taxpayer the PAN was issued to:
| Code | Taxpayer type |
|---|---|
| P | Individual (Person) |
| C | Company |
| H | Hindu Undivided Family (HUF) |
| F | Firm / LLP |
| A | Association of Persons (AOP) |
| T | Trust |
| B | Body of Individuals (BOI) |
| L | Local Authority |
| J | Artificial Juridical Person |
| G | Government |
If you're validating a PAN and the 4th letter isn't one of these, the number is malformed — even if it otherwise matches the regex.
Validating a PAN in three checks
- Length — must be exactly 10 characters.
- Pattern — matches
^[A-Z]{5}[0-9]{4}[A-Z]$. - Taxpayer code — the 4th character must be a recognized type from the table above.
A PAN can pass the regex and still be meaningless if the 4th letter isn't valid — which is why format validation alone doesn't guarantee the PAN is real, only that it's well-formed. Actual registration can only be confirmed against the Income Tax Department's records.
Need a dummy PAN number for testing, not a real one?
If you landed here looking for a fake PAN number, a dummy PAN card number, or a temp/sample PAN for testing a signup form, QA environment, or demo — you don't need a real person's PAN, and you shouldn't use one. What you actually want is a number that's structurally valid (passes the same three checks above) but isn't tied to any real taxpayer.
A randomly generated PAN that follows the AAAAA0000A format with a valid taxpayer-type code will pass any client-side or basic server-side validation, without being a real registered number. That's exactly what a PAN generator should produce — test data that behaves like the real thing without being it.
Try it
The Indian PAN Card Generator & Validator runs all three checks in your browser — paste a PAN to validate it, or generate correctly-formatted dummy PAN numbers for QA, staging, and demo forms. Nothing you type is sent to a server.
Hanuman Singh · built snaptxt.app · hanumansingh.dev