Regex for Indian Phone Number Validation — +91, 91, and 10-Digit Formats
Indian users enter their mobile number in a handful of common ways — sometimes with the +91 country code, sometimes with a plain 91 prefix, and often as just the bare 10-digit number. A validation regex that only supports one of these formats will reject a large share of legitimate users. This guide gives you a pattern that handles all three, plus JavaScript and Python examples.
Understanding the number format
An Indian mobile number has two parts that matter for validation:
- An optional country code — either
+91or bare91. - A 10-digit subscriber number that must start with 6, 7, 8, or 9 — the only digits DoT allocates for mobile number series.
Valid examples include 9876543210, 919876543210, and +919876543210.
The phone number regex pattern
^(?:\+91|91)?[6-9][0-9]{9}$The non-capturing group (?:\+91|91)? makes the country code optional, and [6-9][0-9]{9} enforces the correct starting digit and total length of 10 digits.
JavaScript example
function isValidIndianMobile(number) {
const cleaned = number.replace(/[\s()-]/g, "");
const phoneRegex = /^(?:\+91|91)?[6-9][0-9]{9}$/;
return phoneRegex.test(cleaned);
}
console.log(isValidIndianMobile("+91 98765-43210")); // true
console.log(isValidIndianMobile("9876543210")); // true
console.log(isValidIndianMobile("5876543210")); // false - starts with 5
console.log(isValidIndianMobile("+91987654321")); // false - only 9 digits after codePython example
import re
PHONE_REGEX = re.compile(r"^(?:\+91|91)?[6-9][0-9]{9}$")
def is_valid_indian_mobile(number: str) -> bool:
cleaned = re.sub(r"[\s()-]", "", number)
return bool(PHONE_REGEX.match(cleaned))
print(is_valid_indian_mobile("+91-98765-43210")) # True
print(is_valid_indian_mobile("098765 43210")) # False - leading 0 not allowedExtracting just the 10-digit number
For storage, it's usually best to normalize every valid input down to the bare 10-digit form rather than keeping the country code inconsistently:
function normalizeIndianMobile(number) {
const cleaned = number.replace(/[\s()-]/g, "");
const match = cleaned.match(/^(?:\+91|91)?([6-9][0-9]{9})$/);
return match ? match[1] : null;
}
console.log(normalizeIndianMobile("+91 98765 43210")); // "9876543210"Common mistakes to avoid
- Hardcoding only the +91 prefix and rejecting bare 91 or plain 10-digit input — all three are valid user-facing formats.
- Forgetting to restrict the first digit to 6-9, which lets invalid landline-range numbers slip through as "valid" mobile numbers.
- Not stripping spaces, hyphens, or parentheses before validating, which causes naturally formatted input like
98765 43210to fail unnecessarily.
Frequently Asked Questions
A common pattern is ^(?:\+91|91)?[6-9][0-9]{9}$. It optionally allows a +91 or 91 country-code prefix, then requires a 10-digit number starting with 6, 7, 8, or 9, which covers every active Indian mobile prefix.
The Department of Telecommunications allocates mobile number series only in the 6xxxxxxxxx to 9xxxxxxxxx range. Numbers starting with 0-5 are reserved for landlines, short codes, or are not in use, so restricting the first digit improves validation accuracy.
Strip spaces, hyphens, and parentheses from the input before running the regex, using a replace step like value.replace(/[\s-()]/g, ""). This lets users type numbers in a natural format like +91 98765-43210 while your validation still checks the underlying digits.