Skip to main content

Indonesian NPWP Validator

Validate Indonesian NPWP tax numbers in real time using the Luhn algorithm.

Indonesian NPWP Validation

Validates the 15-digit or 16-digit structure and checks Luhn modulo 10 parity.

Ensures data correctness for tax compliance and accounting software in Indonesia.

Anatomy & Structure of NPWP (Nomor Pokok Wajib Pajak)

The Indonesian Tax ID consists of 15 digits structured in 4 parts:

PositionFieldLengthMeaning & RuleExample
1 & 2Taxpayer Type2 digits01-03=Individual, 04-06=Government, 07-09=Corporations01
3 to 8Sequential Number6 digitsUnique taxpayer sequence234567
9Check Digit1 digitCalculated via **Luhn (Modulo 10)** algorithm on the first 8 digits8
10 to 12KPP Tax Office Code3 digitsLocal tax service office code012
13 to 15Branch Status3 digits000 = Head Office / Sede; 001 to 999 = Branches000

Official Algorithm (Luhn Modulo 10 — Ditjen Pajak)

Official check digit calculation for Indonesian NPWP:

S = Σ luhn(d[i], i) (i=0..7); (S + d[8]) mod 10 === 0
  1. 1. For first 8 digits, multiply odd indices (1, 3, 5, 7) by 2.
  2. 2. If product > 9, sum its digits (e.g. 14 -> 1+4 = 5).
  3. 3. Multiply even indices by 1 and sum all partial values into S.
  4. 4. 9th digit is value 0-9 that satisfies (S + check) mod 10 = 0.

Frequently Asked Questions