Skip to main content
Banking & Finance Tools · 6 min read

Mikrorachunek Generator

Generate structurally valid Polish tax account numbers for software testing, built from the official NRB format with synthetic PESEL or NIP identifiers.

By Matt Rybin
Published Updated

Caution

Looking for your real tax account number?

This tool generates random test numbers for software development. They are structurally valid but do not correspond to real taxpayers.

To find your actual mikrorachunek podatkowy, use the official generator at podatki.gov.pl 1, the only authorised source. Never use a third-party tool to generate the account number you pay taxes to. Your mikrorachunek is tied to your PESEL or NIP and should only be retrieved from the Ministry of Finance or your e-Urząd Skarbowy account.

To learn how the mikrorachunek works, see our Mikrorachunek Checker & Guide.

PESEL
Account Number
—
Identifier Type —

For testing only. Do not use for tax payments.

How a Mikrorachunek Number Is Built

A mikrorachunek follows the 26-digit Polish NRB (Numer Rachunku Bankowego) format 2:

PL + check digits + 10100071222 + Y + PESEL or NIP + zeros

Position Length Content Notes
1–2 2 Check digits MOD 97-10, per ISO 7064
3–10 8 NBP settlement number Always 10100071
11–13 3 NBP supplementary number Always 222
14 1 Identifier type (Y) 1 = PESEL, 2 = NIP
15–26 12 Tax identifier + trailing zeros PESEL (11 digits) + 0, or NIP (10 digits) + 00

The Ministry of Finance publishes this layout as LK10100071222YXXXXXXXXXXXX 3.

Positions 1–26 are the NRB. The full IBAN form prepends the country code: PL + the 26-digit NRB = 28 characters total.

The Check Digit Algorithm

The two check digits use the ISO 7064 MOD 97-10 scheme, the same algorithm IBAN uses worldwide:

  1. Take the 24-digit body: 10100071 + 222 + the type digit Y + the identifier + its trailing zeros.
  2. Append the country code as digits (P → 25, L → 21, giving 2521) and a 00 placeholder for the check digits.
  3. Compute the remainder of that number modulo 97.
  4. The check digits are 98 − remainder, left-padded to two digits.

Worked example with the synthetic PESEL 02070803628:

type digit (PESEL): 1
identifier + zeros (12): 020708036280
body (24 digits): 101000712221020708036280
+ country code + "00": 101000712221020708036280252100
mod 97: 64
check digits = 98 − 64: 34
final NRB (26 digits): 34101000712221020708036280
IBAN form: PL34101000712221020708036280

Code Examples

Copy-pasteable implementations. Both add the type digit and trailing zeros to the identifier, build the body, and compute the check digits with MOD 97-10.

Python:

def generate_mikrorachunek(identifier: str) -> str:
"""
Build a valid mikrorachunek from a PESEL (11 digits) or NIP (10 digits).
For testing only — use podatki.gov.pl for real tax payments.
"""
if len(identifier) == 11:
tail = "1" + identifier + "0" # PESEL: type 1, one trailing zero
else:
tail = "2" + identifier + "00" # NIP: type 2, two trailing zeros
body = "10100071222" + tail # NBP numbers + type + id + zeros
check_digits = 98 - (int(body + "252100") % 97) # PL -> 2521, 00 placeholder
return f"{check_digits:02d}{body}"

JavaScript / TypeScript:

function generateMikrorachunek(identifier: string): string {
// PESEL (11 digits): type 1 + one trailing zero. NIP (10 digits): type 2 + two.
const tail = identifier.length === 11 ? `1${identifier}0` : `2${identifier}00`;
const body = `10100071222${tail}`;
// BigInt required — the 30-digit intermediate exceeds Number.MAX_SAFE_INTEGER
const checkDigits = 98n - (BigInt(`${body}252100`) % 97n);
return `${checkDigits.toString().padStart(2, "0")}${body}`;
}

Format check (regex):

^\d{2}10100071222(1\d{11}0|2\d{10}00)$

This matches the 26-digit NRB structure. It does not verify the check digits or the embedded identifier. Run the full calculation (or our Mikrorachunek Checker) for real validation.

Testing Scenarios

When you need synthetic mikrorachunek numbers:

  • Automated test suites: populate test databases with account numbers that pass format and check-digit validation, without using real taxpayer data.
  • Payment form development: test przelew podatkowy (tax transfer) fields that validate mikrorachunek structure.
  • Accounting software integration: build or test integrations with Polish tax systems (JPK, e-Deklaracje) where payment-routing fields need valid sample data.
  • Data anonymization: replace real mikrorachunek numbers in production database copies with structurally valid synthetic ones.

PESEL or NIP: Identifier Rules

Position 14 says which identifier follows, and zeros fill the positions after it:

Identifier Type digit (position 14) Digits Trailing zeros Used by
PESEL 1 11 1 Individuals without VAT registration
NIP 2 10 2 Companies and VAT-registered sole traders

To generate the embedded identifiers themselves, use our PESEL Generator or NIP Generator. To validate an extracted identifier, use the PESEL Checker or NIP Checker. For other Polish identifiers, see the REGON Generator.

Detecting which type is embedded:

  • Position 14 = 1 → a PESEL in positions 15–25, then one 0.
  • Position 14 = 2 → a NIP in positions 15–24, then 00.
  • Confirm by running the identifier through its own checksum.

Common Questions

Is this the same as the government generator?

No. The official tool at podatki.gov.pl 4 retrieves your real mikrorachunek from the tax database. This tool generates random valid numbers for testing. Never use this tool’s output for an actual tax payment.

Can I use these numbers in production?

No. They are for development and testing only. The embedded PESELs and NIPs are synthetic and do not belong to real taxpayers.

How do I validate a mikrorachunek number?

Use our Mikrorachunek Checker, which runs structure validation, check-digit verification, and identifier extraction.

What’s the difference between NRB and IBAN format?

NRB is the 26-digit domestic format. IBAN prepends PL for international use (28 characters). The check digits are identical in both. The same NRB/IBAN standard governs every Polish bank account. See our IBAN Generator for the general format.

References

  1. Official Mikrorachunek Information Page - Ministry of Finance - podatki.gov.pl ↩

  2. Tax Ordinance Act - Art. 61b (Consolidated Text, Dz.U. 2025 poz. 111) - isap.sejm.gov.pl ↩

  3. Mikrorachunek Podatkowy: Questions and Answers - Ministry of Finance - podatki-arch.mf.gov.pl ↩

  4. Official Mikrorachunek Generator Tool - Ministry of Finance - podatki.gov.pl ↩