Blog

Validating Polish NIP, REGON and PESEL numbers in a form, and company data from GUS

A check digit catches a typo before the form queries any register, and GUS fills in the name, address and REGON, but it cannot tell you whether a company is an active VAT payer

,

The Polish NIP tax ID, REGON business register number and PESEL personal number all end in a check digit computed from the other digits, so a form spots a typo before sending any request. It is the tenth digit of a NIP, the ninth of a REGON, or the fourteenth for a local unit, and the eleventh of a PESEL. A NIP check digit is computed by multiplying the first nine digits by the weights 6, 5, 7, 2, 3, 4, 5, 6, 7 and taking the remainder of the sum divided by 11. You can check a number in our NIP, REGON, PESEL and IBAN validator (the interface is in Polish). A PESEL also encodes the birth date: someone born on 12 January 2005 has month 21, as 20 is added for births from 2000 on.

Three checks in a company form
Step What it checks Where
Validation the length and the check digit in the browser
REGON register name, address, REGON and entity type by NIP GUS BIR1
VAT taxpayer register VAT status and bank accounts Ministry of Finance API

Company data from GUS by NIP

The BIR1 service of GUS, Statistics Poland (the REGON database API), shares REGON data free of charge and searches by NIP, REGON or KRS (the National Court Register number). From 8:00 to 16:59 it takes up to 6,000 requests an hour, from 22:00 to 5:59 up to 10,000. Validating first keeps typos out of that quota. REGON does not hold the active VAT payer status, which the VAT taxpayer register run by the Ministry of Finance shows.

Our validator checks up to 200 numbers at once, tells NIP, REGON, PESEL and IBAN apart by length, rejects a PESEL with a date that does not exist and gives a valid NIP in its EU VAT form.

Register lookups in a CRM are covered in our article on API integrations. A form that fetches company data from GUS on its own is part of our API integrations, which start from PLN 999, and a free quote comes back within an hour.

Was this article helpful?

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.