UAN
Validator, formatter, and masker for EPFO Universal Account Numbers (UAN).
UAN is a 12-digit number issued by the Employees' Provident Fund Organisation (EPFO) of India. It uniquely identifies each EPFO member across employers and persists throughout their career.
Format: 12 consecutive digits — no checksum algorithm is publicly documented by EPFO.
Accepted input forms (all normalised before validation):
Raw digits:
"101234567890"With spaces:
"1012 3456 7890"— internal whitespace strippedWhitespace padded:
" 101234567890 "— leading/trailing whitespace trimmed
Note: Hyphens are not stripped — not a documented UAN input convention. "1012-3456-7890" normalises to "1012-3456-7890" (13 chars after whitespace strip) → InvalidReason.WRONG_LENGTH.
UAN is employment PII — links to individual's EPF contributions and employment history. Always mask before displaying in UI or logging. See mask.
This object is stateless and thread-safe.
Samples
UAN.validate("100123456789") // ValidationResult.Valid
UAN.format("100123456789") // "100123456789"
UAN.mask("100123456789") // "XXXXXXXX6789"