Falsehoods programmers believe about phone numbers
Phone numbers are not ten digits, not US-shaped, and formatting is cosmetic. Here's what breaks phone validation.
Try it — type something other forms reject:
A phone input that assumes ten digits and a US shape locks out most of the planet. Worse, strict validators reject newly-issued real numbers, because their metadata always lags reality.
The falsehoods
- Phone numbers are 10 digits. Lengths vary widely by country.
- Phone numbers are US-shaped.
+44 20 7183 8750,+33 1 42 68 53 00,+91 98765 43210… - Formatting matters. Spaces, dashes, and parentheses are cosmetic;
(650) 253-0000is the same number. - If it’s not in our database, it’s fake. Numbering plans change — a “possible” number may simply be too new to recognize.
- Every number has a US-style area code. Many numbering plans don’t work that way.
How humaneforms handles it
The demo runs the real validatePhone (powered by libphonenumber), normalizing to E.164. A number that’s the right length but not yet recognized as assigned is accepted with a gentle warning, never rejected — so you don’t turn away a real customer with a brand-new SIM.
npm install @humaneforms/react, or get the Pack.