Generator · Hungarian data

Hungarian adószám

Endpoint GET /v1/hu/adoszam

What it covers

Returns a valid Hungarian adószám (company tax number) with a correct törzsszám check digit. Use `format` for the full national number or the HU VAT form. Set `invalid=true` for a number with a deliberately wrong check digit.

How it’s calculated

The Hungarian adószám (VAT/tax number) carries a weighted modulo-10 check digit on the 8-digit törzsszám: the eighth digit is the 10-complement of the weighted sum of the first seven digits (weights 9,7,3,1,9,7,3) taken modulo 10.

Algorithm

  1. Take the seven base (törzsszám) digits d1 d2 d3 d4 d5 d6 d7, in left-to-right order. The first is 1-9, the remaining six are 0-9.
  2. Multiply each digit by its position weight from the fixed weight vector [9, 7, 3, 1, 9, 7, 3]: w1=9, w2=7, w3=3, w4=1, w5=9, w6=7, w7=3.
  3. Sum the seven products: S = 9*d1 + 7*d2 + 3*d3 + 1*d4 + 9*d5 + 7*d6 + 3*d7.
  4. Take that sum modulo 10: r = S mod 10.
  5. Compute the 10-complement modulo 10: check = (10 - r) mod 10. The outer 'mod 10' means an r of 0 yields a check digit of 0 rather than 10, so the result is always a single decimal digit 0-9.
  6. Append the check digit as the eighth digit of the törzsszám, giving the full 8-digit core (7 base + 1 check).
  7. The complete adószám adds two more fields after the törzsszám: a single VAT code Y (1-5) and a two-digit county code ZZ (02-20 as generated; the full national scheme runs 02-44). These carry no checksum. National format is ########-Y-ZZ; the VAT (EU) form is 'HU' followed by the 8-digit törzsszám only.

Worked example

törzsszám base digits 1234567 with check digit ? (full core 1234567?)

Base digits: d1=1, d2=2, d3=3, d4=4, d5=5, d6=6, d7=7; weights [9,7,3,1,9,7,3].
Products: 1*9=9, 2*7=14, 3*3=9, 4*1=4, 5*9=45, 6*7=42, 7*3=21.
Sum S = 9 + 14 + 9 + 4 + 45 + 42 + 21 = 144.
r = 144 mod 10 = 4.
check = (10 - 4) mod 10 = 6.

The check digit is 6, so the full törzsszám is 12345676 (e.g. national form 12345676-1-02, VAT form HU12345676).

Edge cases

  • The check digit is fully determined by the first seven digits, so the eighth digit is never independently drawn — the generator computes it and appends it directly.
  • The outer 'mod 10' in (10 - r) mod 10 matters only when r = 0: it maps the 10-complement of 10 back to 0, keeping the check digit a single digit.

Gotchas

  • Only the first seven digits plus check digit (the törzsszám) participate in the checksum. The VAT code (Y, 1-5) and county code (ZZ, 02-20/02-44) are appended afterward and are NOT covered by any check digit.
  • The weight vector is applied left-to-right starting at the first base digit (weight 9); it is not reversed and there is no separate weight for the check position (validation is done by recomputing from the seven base digits, not by a zero-sum-including-check form).

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 numbers 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.
format"national" | "vat"Rendering: full national number (default) or HU VAT number.
invalidbooleanReturn a number with a deliberately wrong törzsszám check digit.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.

Response fields

FieldTypeDescription
valuestringThe adószám in the requested format (national or VAT).
digitsstringThe canonical 8-digit törzsszám.

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.