Mikrorachunek Generator
Generate structurally valid Polish tax account numbers for software testing, built from the official NRB format with synthetic PESEL or NIP identifiers.
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.
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 + PESEL or NIP
| Position | Length | Content | Notes |
|---|---|---|---|
| 1–2 | 2 | Check digits | MOD 97-10, per ISO 7064 |
| 3–10 | 8 | Bank sort code | Always 10100071 (NBP) |
| 11–13 | 3 | Account type | Always 222 (mikrorachunek marker) |
| 14–26 | 13 | Tax identifier | PESEL (2 leading zeros) or NIP (3 leading zeros) |
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:
- Take the 24-digit body: sort code
10100071+ account type222+ the 13-digit padded identifier. - Append the country code as digits (
P→ 25,L→ 21, giving2521) and a00placeholder for the check digits. - Compute the remainder of that number modulo 97.
- The check digits are
98 − remainder, left-padded to two digits.
Worked example with the synthetic PESEL 92070812345:
identifier (padded to 13): 0092070812345
body (24 digits): 101000712220092070812345
+ country code + "00": 101000712220092070812345252100
mod 97: 36
check digits = 98 − 36: 62
final NRB (26 digits): 62101000712220092070812345
IBAN form: PL62101000712220092070812345
Code Examples
Copy-pasteable implementations. Both pad the identifier to 13 digits, 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.
"""
padded = identifier.zfill(13) # PESEL -> 2 zeros, NIP -> 3
body = "10100071222" + padded # NBP sort code + 222 + id
check_digits = 98 - (int(body + "252100") % 97) # PL -> 2521, 00 placeholder
return f"{check_digits:02d}{body}"
JavaScript / TypeScript:
function generateMikrorachunek(identifier: string): string {
const padded = identifier.padStart(13, "0");
const body = `10100071222${padded}`;
// 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\d{13}$
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
The final 13 digits embed either a PESEL or a NIP, zero-padded:
| Identifier | Digits | Padding | Used by |
|---|---|---|---|
| PESEL | 11 | 2 leading zeros | Individuals without VAT registration |
| NIP | 10 | 3 leading zeros | 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:
- Positions 14–15 =
00with position 16 non-zero → likely a PESEL. - Positions 14–16 =
000→ likely a NIP. - 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 3 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
Top tools
Instant and based on the official algorithms.
Polish Statistics
Official data on demographics, economy, and society.
Poland's Unemployment
Registered unemployment rate and unemployed by education level.
- Registered Unemployment Rate
- 5.7%
- Rate vs Poland Average
- 100.0%
Poland's Tourism
Foreign tourist arrivals, nights spent, and visitors by country of origin.
- Foreign Tourists
- 8,857,567
- Nights Spent
- 20,217,607
Poland's Population
Total population, age distribution, gender ratios, birth/death rates, life expectancy.
- Total Population
- 37,332,510
- Population Density
- 118.9 people/km²
Poland's Fertility
Birth rates, death rates, and natural population change.
- Total Fertility Rate
- 1.099 per woman
- Live Births
- 251,782
Featured as showcase #1322 on dane.gov.pl, Poland's official open data portal.
© 2026 Poland.gg