Skip to content

NPWP

0Prefix for a 15-digit NPWP
15Taxpayer type
067320Registration number
0Check digit
246Tax office (KPP)
000Head office or branch
Head office

Well-formed

Three formats are accepted (PMK 112/2022 as amended by PMK 136/2023):

  • 15 digits, the legacy format (02.973.675.8-100.600).
  • 16 digits, either 0 followed by the legacy 15 digits, or a NIK for individual residents.
  • NITKU, 22 digits: the 16-digit NPWP plus a 6-digit business place number.
Go TypeScript Returns
npwp.Valid(s) npwp.isValid(s) Whether s is a well-formed NPWP or NITKU
npwp.Parse(s) npwp.parse(s) The fields below
npwp.To16(s) npwp.to16(s) The 16-digit form of any accepted format
npwp.Format(s) npwp.format(s) 15 digits in the dotted layout, otherwise digits only
npwp.Mask(s) npwp.mask(s) Last 4 digits visible

Accepted separators: space, . and -.

Field (JSON) Present when Notes
npwp16 Always
npwp15 Not a NIK Legacy 15 digits
nitku Input is a NITKU 22 digits
businessPlace Input is a NITKU Last 6 digits
isNik Always The 16 digits are a NIK
taxOffice Not a NIK 3-digit tax office code (KPP)
status Not a NIK 3-digit status (000 = head office)

There is no official check digit for NPWP published by DJP, so NusaIndex checks structure only. New taxpayers since 2024 receive a 16-digit NPWP without a public structure.

length, charset, nik (16 digits that look like a NIK but are not a valid one), serial.

package main
import (
"fmt"
"github.com/haikalmumtaz233/nusaindex/npwp"
)
func main() {
fmt.Println(npwp.Valid("02.973.675.8-100.600"))
parsed, err := npwp.Parse("02.973.675.8-100.600")
if err == nil {
fmt.Println(parsed.NPWP16, parsed.NPWP15, parsed.TaxOffice, parsed.IsNIK)
}
sixteen, err := npwp.To16("029736758100600")
if err == nil {
fmt.Println(sixteen)
}
formatted, err := npwp.Format("029736758100600")
if err == nil {
fmt.Println(formatted)
}
fmt.Println(npwp.Mask("0029736758100600"))
}
Output
true
0029736758100600 029736758100600 100 false
0029736758100600
02.973.675.8-100.600
************0600