Generator · Hungarian data

Hungarian TAJ

Endpoint GET /v1/hu/taj

What it covers

Returns a valid Hungarian TAJ (társadalombiztosítási azonosító jel) with a correct mod-10 check digit. The TAJ is non-semantic — it encodes no birth date or sex. Set `invalid=true` for a deliberately wrong check digit.

How it’s calculated

The Hungarian TAJ (social-insurance number) check digit is the weighted sum of the first eight digits under alternating weights 3 and 7, taken directly modulo 10 (not a 10's-complement).

Algorithm

  1. A TAJ is 9 digits: 8 payload digits d1..d8 followed by 1 check digit d9.
  2. Assign the fixed position weights [3, 7, 3, 7, 3, 7, 3, 7] to the eight payload digits in order (d1 gets 3, d2 gets 7, d3 gets 3, and so on, alternating).
  3. Compute the weighted sum: sum = 3*d1 + 7*d2 + 3*d3 + 7*d4 + 3*d5 + 7*d6 + 3*d7 + 7*d8.
  4. The check digit is sum mod 10, taken DIRECTLY as the remainder (there is no 10-complement and no 'subtract from 10' step).
  5. The result is always a single decimal digit 0-9, so it is appended as-is to the eight payload digits to form the full 9-digit TAJ.
  6. To validate an existing TAJ: recompute the check digit from the first eight digits and confirm it equals the ninth digit. Equivalently, weighting the ninth digit by -1, the whole nine-digit number sums to 0 mod 10.

Worked example

TAJ payload 12345678? (compute the 9th, check digit)

Payload digits: d1..d8 = 1,2,3,4,5,6,7,8
Weights: 3,7,3,7,3,7,3,7
Products: 3*1=3, 7*2=14, 3*3=9, 7*4=28, 3*5=15, 7*6=42, 3*7=21, 7*8=56
Sum = 3+14+9+28+15+42+21+56 = 188
Check digit = 188 mod 10 = 8 (taken directly as the remainder)

The check digit is 8, so the full valid TAJ is 123456788.

Edge cases

  • Leading-zero TAJ: the first digit may be 0 (produced by the edge generator), so a numeric parse silently drops it to eight characters — TAJ must be kept as a string.
  • Zero check digit: the ninth digit can legitimately be 0 when the weighted sum is a multiple of 10 (e.g. sum 188 gives 8, but sums like 190 would give 0), so a 'trailing digit is non-zero' assumption is wrong.
  • Repeated-pattern payload: all eight payload digits identical still produces a valid TAJ, so 'looks like a placeholder' filters wrongly reject genuine values.

Gotchas

  • The check digit is the raw remainder sum mod 10 — NOT 10 minus the remainder. Applying a 10's-complement (as many other national schemes use) yields the wrong digit.
  • The weights alternate 3,7,3,7,3,7,3,7 across the eight payload digits; do not start with 7 or use a Luhn-style 2,1,2,1 pattern.
  • The modulus is 10 despite the primitive living in mod11.ts — only the generic weightedSum helper is reused; the '% 10' and the 3/7 weights are supplied by the TAJ generator itself.

Parameters

ParameterTypeDescription
countinteger1–1000Number of records to return, 1–1000 (your plan may lower this). Omitted returns a single record; set it for a batch.
edgebooleanRestrict output to valid edge-case TAJs from the rare corners.
extremebooleanReturn a correct value wrapped in a hostile encoding (untrimmed whitespace, invisible/zero-width characters, BOM, or bidi/combining marks). Homoglyphs are excluded so the value stays machine-parseable; it still validates after normalisation.
invalidbooleanReturn a TAJ with a deliberately wrong check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe TAJ as a bare 9-digit string.
digitsstringThe canonical 9-digit number.

Other generators for Hungary

See all generators for Hungary →

The same kind of identifier elsewhere

Try it

Generate a live example below — every response is valid by format and entirely synthetic.