Phone number input on mobile
Use type="tel", accept what people type, and tidy it up afterwards.
Last updated November 30, 2026 · Keyboards checked on real phones: iPhone (iOS 17 and 18), Galaxy S24 and S25, Pixel 9, Motorola Edge 50 Fusion
<label for="ph">Mobile number</label>
<input id="ph" name="phone" type="tel" autocomplete="tel">
Why type="tel"
It opens the phone pad: big digit keys, plus a key for + * #. The pad has no letters and no space, which suits a phone number. Unlike type="number", the value is kept as text, so a leading 0 or + survives.
Do not over-validate
People type phone numbers in many ways: (555) 010-0199, 555.010.0199, +1 555 010 0199. On the iPhone phone pad they cannot type the brackets, dashes or spaces at all. But autofill and paste can bring them in. A strict pattern such as [0-9]{10} rejects perfectly good pasted numbers. Accept the input, strip everything that is not a digit or a leading +, and validate the digits.
Country codes
If you accept international numbers, keep the + key reachable: on the iPhone phone pad it is on the +*# key. A separate country selector with the code shown, such as "+44 United Kingdom", helps people who do not know their own country code. Give it autocomplete="tel-country-code" and the number field autocomplete="tel-national".
Example placeholder trap
A placeholder like 555-010-0199 on a type="tel" field suggests people should type dashes, which the phone pad cannot do. Use a hint below the label instead, such as "Digits only, including area code", or show an example without punctuation. The checker flags placeholders that the keyboard cannot type.
The phone pad on each phone
| Phone | Keys on the type="tel" pad |
|---|---|
| iPhone | 0–9 and a + * # key |
| Galaxy (Samsung Keyboard) | 0–9, * # +, and a comma |
| Pixel / Motorola (Gboard) | 0–9, * # +, point, dash and space |
So the same field can receive "5550100199" from an iPhone and "555-010-0199" or "555 010 0199" from a Pixel. Your code should treat all three as the same number.
Clean the number, then check it
function cleanPhone(raw) {
const s = raw.trim();
const plus = s.startsWith('+') ? '+' : '';
return plus + s.replace(/\D/g, '');
}
cleanPhone('(555) 010-0199') // "5550100199"
cleanPhone('+44 20 7946 0958') // "+442079460958"
| What people enter | Stored as |
|---|---|
| (555) 010-0199 | 5550100199 (add +1 if US only: +15550100199) |
| 555.010.0199 | 5550100199 |
| +1 555 010 0199 | +15550100199 |
| +44 20 7946 0958 | +442079460958 |
Store numbers in the international E.164 format (+ country code, then digits) if you send text messages, and show them back to people in their own local style.
Labels that help
"Phone" is vague. "Mobile number (for delivery updates)" tells people which number and why. If the number is optional, say so in the label rather than with an asterisk on the other fields.
Checklist before you ship
type="tel"andautocomplete="tel"on the field.- No
patternthat demands brackets, dashes or an exact length. - A label that says which number and why, and a hint without punctuation the pad cannot type.
- Server code that cleans the value the same way as the browser.
- A test on an iPhone and an Android phone, typing and autofilling.
If the form serves several countries, test a number from each one, including one with a leading 0 after the country code, such as a UK mobile written as 07700 900123.
Frequently asked questions
Should a phone field use inputmode="numeric"?
No. type="tel" opens a better pad, includes the + key and tells assistive technology it is a phone number.
Can people type a dash on the iPhone phone pad?
No. The pad has 0–9 and + * #. Dashes only arrive through paste or autofill, so strip them rather than requiring them.
How should I store phone numbers?
As text in E.164 format, such as +15550100199. Never as a number, which drops the + and leading zeros.
Found a mistake or want a check added? Write to contact (at) mobileformcheck.com.