Australian Medicare Number Validation
Check whether an Australian Medicare number is valid using the official checksum algorithm published by Services Australia. Enter the 11-digit number from your Medicare card -- including the identifier, issue number, and Individual Reference Number (IRN) -- and this tool validates its format and check digit instantly. Used in production by Doccy for Australian telehealth patient verification.
Validate Medicare Number
9-digit card number
1 digit
1 digit
Testing Examples
Not real Medicare numbers. Click to populate.
Result
Enter a Medicare number and click Validate to see results.
| Component | Digits | Description |
|---|---|---|
| Medicare Number | 9 | 8-digit identifier + 1-digit checksum. First digit 2-6. |
| Issue Number | 1 | Card reissue count (must not be zero) |
| IRN | 1 | Identifies the individual on the card |
The IRN is essential for Medicare claim forms.
Where to Find Each Component on Your Card

Medicare Number
8-digit identifier + 1-digit checksum displayed as the main number on the card.

Expiry Date
Displayed in MM/YYYY format in the bottom right area.

Issue Number
A single digit after the Medicare number indicating reissue count.

Individual Reference Number (IRN)
Appears to the left of each person's name on the card.
How the Australian Medicare Checksum Algorithm Works
The Medicare check digit is calculated by multiplying each of the first 8 digits of the identifier by a corresponding weight, summing the products, and taking the remainder when divided by 10. The result must equal the 9th digit (the check digit). Additionally, the issue number (10th digit) must not be zero.
Worked Example
Using identifier 29518731 from 2951 87312 5 1:
| Pos | Digit | Weight | Product |
|---|---|---|---|
| 1 | 2 | 1 | 2 |
| 2 | 9 | 3 | 27 |
| 3 | 5 | 7 | 35 |
| 4 | 1 | 9 | 9 |
| 5 | 8 | 1 | 8 |
| 6 | 7 | 3 | 21 |
| 7 | 3 | 7 | 21 |
| 8 | 1 | 9 | 9 |
| Sum = | 132 | ||
| Mod 10 = | 2 | ||
The 9th digit is 2, matching the check digit. Validation passes.
First Digit: State or Territory of Issue
| Digit | State / Territory |
|---|---|
| 2 | New South Wales (NSW) |
| 3 | Victoria (VIC) |
| 4 | Queensland (QLD) |
| 5 | South Australia (SA) |
| 6 | Western Australia (WA), Tasmania (TAS), Northern Territory (NT), Australian Capital Territory (ACT) |
Validate Medicare Numbers in Code
Code snippets for validating Australian Medicare numbers in TypeScript and Python, plus a regex for format checks. Full implementation available as an open-source GitHub Gist.
Regex Pattern (Format Check Only)
Does not verify the checksum -- use the algorithm for full validation.
// Raw 11-digit format
/^[2-6]\d{10}$/
// Matches: 29518731251
// Rejects: 19518731251 (first digit must be 2-6)
// Rejects: 2951873125 (must be exactly 11 digits)Code Samples (TypeScript & Python)
TypeScript
const WEIGHTS = [1, 3, 7, 9, 1, 3, 7, 9] as const;
function validateMedicareNumber(input: string): boolean {
const digits = input.replace(/\D/g, "");
if (digits.length !== 11) return false;
const firstDigit = parseInt(digits[0], 10);
if (firstDigit < 2 || firstDigit > 6) return false;
// Checksum: weighted sum of first 8 digits mod 10 = 9th digit
let sum = 0;
for (let i = 0; i < 8; i++) {
sum += parseInt(digits[i], 10) * WEIGHTS[i];
}
if (sum % 10 !== parseInt(digits[8], 10)) return false;
// Issue number (10th digit) must not be zero
if (digits[9] === "0") return false;
return true;
}Python
def validate_medicare_number(medicare_number: str) -> bool:
"""Validate an Australian Medicare number using the official checksum algorithm."""
digits = "".join(c for c in medicare_number if c.isdigit())
if len(digits) != 11:
return False
if not (2 <= int(digits[0]) <= 6):
return False
# Checksum: weighted sum of first 8 digits mod 10 = 9th digit
weights = [1, 3, 7, 9, 1, 3, 7, 9]
total = sum(int(digits[i]) * weights[i] for i in range(8))
if total % 10 != int(digits[8]):
return False
# Issue number (10th digit) must not be zero
if digits[9] == "0":
return False
return True