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:
| Position | Field | Length | Meaning & Rule | Example |
|---|---|---|---|---|
| 1 & 2 | Taxpayer Type | 2 digits | 01-03=Individual, 04-06=Government, 07-09=Corporations | 01 |
| 3 to 8 | Sequential Number | 6 digits | Unique taxpayer sequence | 234567 |
| 9 | Check Digit | 1 digit | Calculated via **Luhn (Modulo 10)** algorithm on the first 8 digits | 8 |
| 10 to 12 | KPP Tax Office Code | 3 digits | Local tax service office code | 012 |
| 13 to 15 | Branch Status | 3 digits | 000 = Head Office / Sede; 001 to 999 = Branches | 000 |
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. For first 8 digits, multiply odd indices (1, 3, 5, 7) by 2.
- 2. If product > 9, sum its digits (e.g. 14 -> 1+4 = 5).
- 3. Multiply even indices by 1 and sum all partial values into S.
- 4. 9th digit is value 0-9 that satisfies (S + check) mod 10 = 0.