How the teudat zehut check digit works
An Israeli ID number has 9 digits, and the last one is a check digit. It is calculated from the 8 digits before it so that a typing mistake shows up immediately. The method is a variant of the Luhn algorithm, the same one that checks credit card numbers:
- Pad the number to 9 digits with zeros on the left.
- Multiply each digit by a weight according to its position: the first by 1, the second by 2, the third by 1, and so on alternately. The check digit, the ninth, is multiplied by 1.
- Replace a product of 10 or more with the sum of its digits: 12 counts as 3 and 16 as 7. It is the same as subtracting 9.
- Add up all the results. The number is valid if the sum is divisible by 10.
Example: the check digit of 12345678
| Digit | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 |
|---|---|---|---|---|---|---|---|---|
| Times | 1 | 2 | 1 | 2 | 1 | 2 | 1 | 2 |
| Added | 1 | 4 | 3 | 8 | 5 | 3 | 7 | 7 |
The sum is 1 + 4 + 3 + 8 + 5 + 3 + 7 + 7 = 38. The 6 and the 8 were doubled to 12 and 16, so they count as 3 and 7. 2 is missing to reach 40, the next multiple of 10, so the check digit is 2 and the full number is 123456782. In the tool above you can choose Calculate the check digit to see the same table for any number.
123456782is a demonstration sequence. We do not show real people's numbers on this page, and the tool does not generate random numbers, because a randomly generated valid number can belong to a real person.
Valid does not mean it exists
The check digit only confirms that the number is well formed. Exactly one in ten 9-digit numbers passes, even if it was never issued. It catches every single-digit mistake and every swap of two adjacent digits except 09 becoming 90 or the reverse. It does not tell you who owns the number, whether the card is current, or whether it was reported lost or stolen.
To know that a person is who they say they are, you need to see the card itself or use an official identification service. A company can be looked up by number in the Registrar of Companies corporate search, or with our Israeli company lookup.
Company, VAT dealer and non-profit numbers: the same check digit
A company number (H.P., chet-pe), partnership number and non-profit (amuta) number also have 9 digits, the last of which is a check digit calculated the same way. The Registrar of Companies does not publish the formula, so we tested it ourselves on its open databases on data.gov.il in October 2026:
- Companies: 732,514 of 732,515 numbers pass the check. Only one number in the database fails.
- Partnerships: all 29,074 numbers pass.
- Non-profits: all 73,899 numbers starting with 58 pass.
Corporate numbers start with 5, and the first two digits show the type of entity:
| Prefix | Type |
|---|---|
| 51, 52 | Israeli company |
| 53 | Foreign partnership registered in Israel |
| 54, 55 | Israeli partnership |
| 56 | Foreign company registered in Israel |
| 58 | Non-profit (amuta) |
An osek murshe (licensed VAT dealer) is not a separate kind of number. According to the Israel Tax Authority, a private individual's tax ID is their ID number, so a sole trader is usually registered under their teudat zehut number and a company under its company number. Either way, the same check digit validates a dealer number. In the tool, choose Company or VAT dealer number and it also shows the type of entity by prefix.
Checking ID numbers in Excel, Google Sheets and code
When you import a customer list into a CRM or check an employee file, it is handy to check a whole column at once. The formulas work in Excel 2010 and later and in Google Sheets, with no macro or add-in.
Excel formula to validate an ID number
The first number is in cell A2. Paste the formula into an empty cell in the same row and drag it down. The result is TRUE for a valid number and FALSE for an invalid one, and leading zeros that Excel removed are restored automatically.
=AND(IFERROR(--A2<>0,FALSE),IFERROR(LEN(TEXT(A2,"0"))<=9,FALSE),IFERROR(MOD(SUMPRODUCT(MID(TEXT(A2,"000000000"),{1,2,3,4,5,6,7,8,9},1)*{1,2,1,2,1,2,1,2,1}-9*(MID(TEXT(A2,"000000000"),{1,2,3,4,5,6,7,8,9},1)*{1,2,1,2,1,2,1,2,1}>9)),10)=0,FALSE))A cell with a dash or space, such as 12345678-2, returns FALSE. Clean them first: select the column, press Ctrl+H and replace the dash with nothing.
Formula to calculate the check digit
With the 8 digits in cell A2, the formula returns the ninth digit. If the formula is in B2, the full number is =TEXT(A2,"00000000")&B2.
=MOD(10-MOD(SUMPRODUCT(MID(TEXT(A2,"00000000"),{1,2,3,4,5,6,7,8},1)*{1,2,1,2,1,2,1,2}-9*(MID(TEXT(A2,"00000000"),{1,2,3,4,5,6,7,8},1)*{1,2,1,2,1,2,1,2}>9)),10),10)JavaScript function for a website form
The function takes a string or number, removes spaces and dashes, pads with zeros and returns true or false. It suits validation as the user types. Repeat the same check on the server, because browser checks can be bypassed.
function isValidIsraeliId(value) {
const digits = String(value).replace(/[\s-]/g, '')
if (!/^\d{1,9}$/.test(digits) || Number(digits) === 0) return false
const id = digits.padStart(9, '0')
let sum = 0
for (let i = 0; i < 9; i++) {
let step = Number(id[i]) * (i % 2 === 0 ? 1 : 2)
if (step > 9) step -= 9
sum += step
}
return sum % 10 === 0
}ID numbers in forms, CRMs and invoices
Israeli businesses ask for an ID or company number on sign-up forms, orders, contracts, payslips and tax invoices to business customers, which carry the customer's dealer number. Checking the check digit as the number is typed stops a mistake before it is saved in the CRM, and before an invoice goes out with a wrong dealer number.
Privacy: an ID number is personal data
Since Amendment 13 to the Privacy Protection Law took effect on 14 August 2025, section 3 of the law defines personal data as information about an identified or identifiable person, and lists the ID number among the identifying details. The Privacy Protection Authority has also said that an ID number is protected information, to be collected, or the card copied, only when there is a real need. In practice:
- Ask for an ID number only when you need it, and say on the form why it is required and what happens if it is not given (section 11).
- Do not send it by plain email, put it in the page URL, or pass it to analytics or advertising tools.
- Keep it only as long as needed, and give access only to those who work with it.
- Update your website privacy policy.
The tool on this page checks the number in your browser only. It is not sent to a server, not stored and not added to the page address.
Common mistakes
- Dropped zeros. Excel stores an ID number as a number, so 012345674 becomes 12345674. Restore the zeros with Format Cells, custom format 000000000, or with the formula
=TEXT(A2,"000000000"). When importing a CSV, set the column to text. - Missing check digit. Older documents sometimes write the check digit after a dash, and people type only the 8 digits before it. Such a number looks invalid.
- Number input fields.A field of type number drops leading zeros and also accepts the letter e. Use a text field with a numeric keypad, inputmode="numeric", and a check digit validation.
- Checking length only. A form that only checks for 9 digits lets every typo through, and a form that demands exactly 9 digits blocks numbers whose leading zero was dropped.
- Assuming the number belongs to the customer. A valid number can belong to anyone, or to no one.
Sources
- Wikipedia: Israeli identity card: 9 digits, the last of which is a check digit, issued by the Population Registry
- python-stdnum: Israeli identity number: open-source validation library with examples of a valid number and a wrong check digit; the same library covers company numbers (stdnum.il.hp)
- data.gov.il: Registrar of Companies database: our check: 732,514 of 732,515 company numbers pass the same check digit
- data.gov.il: partnerships database: our check: all 29,074 partnership numbers pass
- data.gov.il: non-profits and public benefit companies database: our check: all 73,899 non-profit numbers starting with 58 pass
- Israel Tax Authority via the OECD portal: Information on Tax Identification Numbers, Israel: an individual's tax ID is their ID number, and a company's is a 9-digit number
- Privacy Protection Authority: collecting ID numbers and copying ID cards (Hebrew): an ID number is protected information, collected only when there is a need
The algorithm, formulas and code were checked on 23 October 2026 against the sources and against every corporate number in the open databases. The Population Authority and the Registrar of Companies do not publish the formula themselves.
Need a form or CRM that validates ID, company and phone numbers as people type? We build that.
Custom software development