Regex for PAN card number (India)

A PAN (Permanent Account Number) is a 10-character code issued by the Income Tax Department: five letters, four digits, then one letter. This pattern checks that shape, which is what most sign-up and KYC forms need before sending the value to a verification service.

The pattern

/\b[A-Z]{5}[0-9]{4}[A-Z]\b/g

The tester opens with this pattern and the examples below already loaded. Nothing you type is uploaded.

How it works

\b
Word boundary, so the PAN is not found inside a longer string.
[A-Z]{5}
Five uppercase letters. The fourth character encodes the holder category, for example P for an individual.
[0-9]{4}
Four digits (a sequence number).
[A-Z]
One final uppercase check letter.

Examples

Matches

  • ABCDE1234F
  • AAAPL1234C
  • BNZPM2501F

Does not match

  • abcde1234f
  • ABCD12345E
  • ABCDE12345

Use it in JavaScript

const re = /\b[A-Z]{5}[0-9]{4}[A-Z]\b/g;

// Find every match in a block of text
const found = text.match(re);

// Validate that a whole value matches (no stray characters around it)
const exact = new RegExp('^(?:' + re.source + ')$', re.flags.replace('g', ''));
const isValid = exact.test(value);

Limits and tips

  • This checks the format only. It cannot tell whether the PAN was actually issued or belongs to the person entering it; use an official verification service for that.
  • It is case-sensitive on purpose. If your form accepts lowercase input, convert it with toUpperCase() first rather than adding the i flag, so you store one canonical form.
  • To restrict the fourth character to valid holder categories, replace the first [A-Z]{5} with [A-Z]{3}[ABCFGHLJPT][A-Z] and check the Income Tax Department’s current list of category letters.

Frequently asked questions

What is the format of a PAN card number?

Ten characters in the order AAAAA9999A: five letters, four digits and one letter, all uppercase.

Does this regex confirm a PAN is real?

No. It only confirms the format. A string like ABCDE1234F passes even if no such PAN exists.