Skip to content
CheckcraftDownload
Practical workflow

Russian INN, OGRN and KPP generator: test data for companies and sole traders

Testing company sign-up, a counterparty form or an API needs a plausible Russian taxpayer number, and real company details in test data are an unnecessary risk. These numbers are random but pass the check-digit test.

Checkcraft ·

Get help with your first test →

INN: 10 and 12 digits

A company INN has 10 digits; an individual or sole trader INN has 12. The first four digits are the tax office code, and the first two of them match the region code. The last digit of a company INN and the last two digits of an individual INN are check digits.

How the INN check digit is computed

Multiply each digit by its weight and add them up, take the remainder of division by 11, then the remainder of that by 10. For 10 digits the weights are 2, 4, 10, 3, 5, 9, 4, 6, 8. For a 12-digit INN the first check digit uses the first ten digits with weights 7, 2, 4, 10, 3, 5, 9, 4, 6, 8, and the second uses the first eleven with weights 3, 7, 2, 4, 10, 3, 5, 9, 4, 6, 8.

API call diagram: method and URL, headers, body, status and response body, logs and database
const W = [2, 4, 10, 3, 5, 9, 4, 6, 8];
const check = inn => W.reduce((s, w, i) => s + w * inn[i], 0) % 11 % 10;

check('7707083893');  // 3, the last digit of Sberbank's INN

OGRN, OGRNIP and KPP

An OGRN has 13 digits: the record type (1 or 5), the last two digits of the year, the region code, the record number and a check digit. The check digit is the remainder of the first 12 digits divided by 11, with a remainder of 10 written as 0. An OGRNIP has 15 digits and starts with 3; its check digit is the last digit of the remainder of the first 14 digits divided by 13. A KPP has 9 digits and no check digit: the tax office code, the registration reason (01 means the company’s own address) and a sequence number.

What to check in tests

A number with valid check digits should pass, and one with a broken last digit should be rejected with a clear 400 or 422. A 10-digit INN should not be accepted in an individual INN field, and vice versa. In Checkcraft these checks are no-code rules, and the numbers are fed into requests from a CSV.

Layers of an API call check: status, headers, body, calculations, logs, database

These numbers are not real

A number is built from random digits and only passes the checksum test. It may match someone’s real number by chance, so use it in test environments only, never in documents, contracts or filings. Generation and checking run in your browser; the page sends nothing to a server.

More on test data

Where to use generated data: Practice API with bugs: find all 10.

Next step

Repeat this on your own API

Checkcraft is a desktop app that saves API response checks without code and shows what did not match. Start with a sample, then use your own sanitized data. Free runs on Windows and Linux with no time limit.

Download FreeDownload and first run

No sign-up or email needed, the archive is ready in a couple of minutes. See the edition limits.

References

Wikipedia (Russian): INN · Wikipedia (Russian): OGRN

Start with the linked example and compare its result with your own test requirement.

Ask a person

Get help with your first test

Tell us what you want to test or where you got stuck. We can help you start Checkcraft, choose an example and understand your first run. You can ask before downloading.

The Telegram group is public: do not post passwords, tokens or confidential work data. A description of your task is enough to start.

You can also email us support@checkcraft.ru

No account required. We will reply by email. This is a support request, not a newsletter subscription.