Skip to content

inn ​

The string is a Russian tax ID (INN) with a valid checksum: 10 digits for companies, 12 for individuals.

Signature ​

ts
function inn(msg?: Message): Action<string>
function isInn(value: string): boolean

Parameters ​

ParameterTypeDescription
msgMessageCustom error message

Error codes ​

CodeWhenDefault message
innInvalid checksum or formatInvalid INN

You can change the texts: see Messages & i18n.

Notes ​

The checksum is verified by the tax service algorithm — a single-digit typo is almost always caught. Whether such a company exists is not checked.

  • Spaces and dashes are allowed: a masked value can be validated.
  • The isInn function is available separately — for checks without a schema.
  • Format the input with a mask from tinyval-mask.

Example ​

ts
const Company = object({ inn: pipe(string(), inn()) });

isInn('7707083893'); // true

See also ​