Generator · Greek data

Greek AMKA

Endpoint GET /v1/gr/amka

What it covers

Returns a valid Greek AMKA (social-security number) with a correct Luhn check digit. Constrain with `sex` and age/birth-date filters (the full birth date is encoded). Contradictory combinations are rejected with a 400. Set `invalid=true` for a deliberately wrong check digit.

How it’s calculated

The 11th digit of a Greek AMKA is a standard Luhn (mod-10) check digit computed over the first ten digits.

Algorithm

  1. Take the first ten digits of the AMKA as the payload (positions 1-10): a 6-digit DDMMYY birth-date head, a 3-digit serial (positions 7-9), and a sex/parity digit (position 10). The check digit is the 11th and is NOT part of the payload.
  2. Process the ten payload digits from right to left. Starting with the rightmost payload digit, alternately mark digits as 'doubled' and 'not doubled' — the rightmost payload digit IS doubled, the next is not, the next is doubled, and so on.
  3. For each digit marked 'doubled', multiply it by 2; if the product exceeds 9, subtract 9 from it (equivalently, add the two digits of the product).
  4. For each digit marked 'not doubled', keep its value unchanged.
  5. Add all the resulting values together to get sum.
  6. Compute the check digit as (10 - (sum mod 10)) mod 10. The outer mod 10 makes a residue of 0 map to a check digit of 0 rather than 10.
  7. Append this single check digit as the 11th digit to form the full AMKA.

Worked example

AMKA for a male born 01/01/1985, serial 234, sex digit 7: 0101852347? (10-digit payload, check digit unknown)

Payload (positions 1-10): 0 1 0 1 8 5 2 3 4 7
Walk right to left, doubling the rightmost payload digit first (doubled positions marked *):
pos10 = 7* -> 7*2 = 14 -> 14-9 = 5
pos9  = 4  -> 4
pos8  = 3* -> 3*2 = 6
pos7  = 2  -> 2
pos6  = 5* -> 5*2 = 10 -> 10-9 = 1
pos5  = 8  -> 8
pos4  = 1* -> 1*2 = 2
pos3  = 0  -> 0
pos2  = 1* -> 1*2 = 2
pos1  = 0  -> 0
sum = 5+4+6+2+1+8+2+0+2+0 = 30
check = (10 - (30 mod 10)) mod 10 = (10 - 0) mod 10 = 0

The check digit is 0, giving the full AMKA 01018523470.

Edge cases

  • The 10th digit encodes sex by parity: odd -> male, even -> female. The generator sets it deliberately (sexDigit = random(0..4)*2 + parity) so the reported sex is truthful; the checksum itself does not enforce sex parity.
  • The first six digits are a DDMMYY birth-date head; the encodable birth-date range is clamped to 1900-01-01 through 2099-12-31 (two-digit year, no explicit century marker in the number).

Gotchas

  • The check digit uses the (10 - (sum mod 10)) mod 10 form: when sum mod 10 is 0 the check digit is 0, not 10. Forgetting the outer mod 10 yields an invalid two-digit result.
  • Luhn doubling starts on the RIGHTMOST PAYLOAD digit (position 10), because the check digit is appended to its right and is excluded from the payload. Doubling the wrong alternating set inverts the parity and produces a wrong digit.

Parameters

ParameterTypeDescription
atAgeintegerExact age in years at request time.
bornAfterstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born after this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornBeforestringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born before this date or fragment (YYYY, YYYY-MM, YYYY-MM-DD).
bornOnstringpattern ^\d{4}(?:-\d{2}(?:-\d{2})?)?$Born on a date or within a fragment: YYYY, YYYY-MM, or YYYY-MM-DD.
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 edge-case values.
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 an AMKA with a deliberately wrong Luhn check digit; date/sex stay valid.
olderThanintegerMinimum age in years at request time.
seedintegerInteger seed for reproducible output: the same seed always yields the same record.
sex"m" | "f"Encoded sex: "m" or "f".
youngerThanintegerMaximum age in years at request time.

Response fields

FieldTypeDescription
valuestringThe canonical 11-digit AMKA.
digitsstringThe 11 AMKA digits, identical to `value`.
birthDatestringThe encoded birth date, ISO `YYYY-MM-DD`.
sex"m" | "f"Encoded sex: `m` (odd) or `f` (even) 10th digit.

Other generators for Greece

See all generators for Greece →

The same kind of identifier elsewhere

Try it

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