Skip to content
S
Softween Tools
Back to Blog
dev-helpers

Turkish ID Number Validation: Algorithm and Rules

Learn how Turkish ID (TC Kimlik) number validation works, the algorithm behind it, and validate numbers with our free tool.

·Softween

Turkish ID numbers (TC Kimlik Numarası) are 11-digit unique identifiers assigned to every Turkish citizen. Understanding their validation algorithm is essential for developers building applications for the Turkish market.

Structure of a Turkish ID Number

A valid Turkish ID number follows strict mathematical rules:

  • 11 digits long
  • First digit is never 0
  • Digits are referred to as d1, d2, d3 ... d11
  • Validation Algorithm

    Rule 1: Check Digit 10

    d10 = ((d1 + d3 + d5 + d7 + d9) × 7 - (d2 + d4 + d6 + d8)) mod 10
    

    Rule 2: Check Digit 11

    d11 = (d1 + d2 + d3 + d4 + d5 + d6 + d7 + d8 + d9 + d10) mod 10
    

    Rule 3: Basic Checks

  • Must be exactly 11 digits
  • First digit cannot be 0
  • Must be a numeric string
  • Validation Summary

    RuleDescription
    LengthExactly 11 digits
    First digitCannot be 0
    10th digitDerived from odd/even position digits
    11th digitSum of first 10 digits mod 10

    Example Validation

    For the number 10000000146:

  • Odd positions (1,3,5,7,9): 1+0+0+0+0 = 1
  • Even positions (2,4,6,8): 0+0+0+0 = 0
  • d10 = (1 × 7 - 0) mod 10 = 7 mod 10 = 7 — but d10 should be 4, so this requires actual test numbers.
  • The algorithm ensures that random 11-digit numbers are extremely unlikely to pass validation, providing a reliable check for data integrity.

    Developer Tips

  • Always validate on the server side, not just the client
  • Store TC numbers as strings to preserve leading zeros in related fields
  • Never use TC numbers as primary keys in databases
  • Comply with KVKK (Turkish data protection law) when storing personal data
  • Try It Yourself

    Validate any Turkish ID number instantly with our free TC Kimlik Validator.

    Related Tools

    Command Palette

    Search for a command to run...