top of page
PAN Card Validation
PAN Card
-
Permanent Account Number (PAN) is a code that acts as an identification for individuals, families and corporates (Indian or Foreign), especially those who pay Income Tax.
-
The PAN is unique to each individual and is valid for the lifetime of the holder, throughout India.
Structure of PAN card
A sequence of alphabets from AAA to zzz.
1st - 3rd letters:
Informs about the type of holder of the Card.
4th letter:
-
C — Company
-
P — Person
-
H — HUF(Hindu Undivided Family)
-
F — Firm
-
A — Association of Persons (AOP)
-
T — AOP (Trust)
-
B — Body of Individuals (BOI)
-
L — Local Authority
-
J — Artificial Judicial Person
-
G — Government
5th letter:
Is the first character.
-
of the surname/ last name of the person, in the case of "Personal" pan card, where the fourth character is "p" or
-
of the name of the Entity/ Trust/ Society/ Organisation, where the character is "C", "H", "F", "A", "T", "B", "L","J", "G".
6th - 9th letters
The sequence of numbers from 0001 to 9999.
Last digit :
an alphabetic check digit.
VALIDATING PAN NUMBER
Step 1
-
Check the length of the PAN number, whether 10 or not.
AAAAA9999A
Step 2
-
The entered number follows the PAN structure.
-
First five characters are letters
AAAAA9999A
Step 3
-
Check next 4 are numerals.
AAAAA9999A
Step 4
-
Check the last character is a letter.
AAAAA9999A
Step 5
-
Check the 5th letter match with the first letter of individual/company's name.
Name:
Javed Akhtar
AAAAA9999A
Step 6
-
If all the steps are satisfied, then PAN card is valid.
AAAAA9999A
-
Given below is the java program which makes use of regular expressions to validate the PAN number.
JAVA PROGRAM for validation of PAN card
import java.util.*;
class ValidPAN {
public static void main(String[] args) {
Scanner scn = new Scanner(System.in);
int t = scn.nextInt();
String s [ ] = new String [ t ];
boolean output [ ] = new boolean [ t ] ;
for (int i=0; i<s.length;i++)
{
s [ i ] = scn.next();
boolean ss = s [ i ].matches("[A-Z]{5}\\d{4}[A-Z]{1}");
output[i]=ss;
}
for (boolean b:output)
{
System.out.println(b);
}
}
}
bottom of page