Firebase rejected your phone number format. Phone numbers must be in E.164 format with country code (e.g., +1 650-555-3434). Fix the format or use a valid test number during development.
The "auth/invalid-phone-number" error occurs when Firebase Authentication cannot parse the phone number you provided into the E.164 international format. E.164 is the standard format for phone numbers used globally: [+][country code][area code][subscriber number]. Firebase enforces this strict format to ensure phone authentication works consistently across different regions and carriers. The error may also occur if the phone number is missing required digits, has invalid characters, or doesn't match the expected length for the given country code.
E.164 format is: [+][country code][phone number with no spaces or dashes]
Examples of correct formats:
- United States: +1 650-555-3434 → +16505553434
- United Kingdom: +44 7444 555 666 → +447444555666
- Germany: +49 30 123456 → +4930123456
Remove all spaces, dashes, parentheses, and other formatting characters. Keep only the "+" prefix and digits.
Ensure you have the correct country code for the user's location. Country codes vary by nation:
- USA/Canada: +1
- UK: +44
- Germany: +49
- France: +33
- Australia: +61
Double-check the country code against the user's actual location. If unsure, ask the user to select their country in your app before submitting the phone number.
During development, Firebase allows you to register test phone numbers in the Firebase Console:
1. Open Firebase Console → Authentication → Sign-in method
2. Click on "Phone" provider
3. Expand "Phone numbers for testing"
4. Add a test phone number (e.g., +1 650-555-3434) with a test verification code (e.g., 123456)
When you use a registered test phone number, Firebase will not send an actual SMS. Instead, it will immediately verify with the code you specified.
Catch and handle the error properly to inform users:
JavaScript/Web:
try {
await firebase.auth().signInWithPhoneNumber(
"+1 650-555-3434",
appVerifier
);
} catch (error) {
if (error.code === "auth/invalid-phone-number") {
console.error("Invalid phone format. Use: +[country][number]");
}
}Flutter:
await FirebaseAuth.instance.verifyPhoneNumber(
phoneNumber: "+1 650-555-3434",
verificationFailed: (FirebaseAuthException e) {
if (e.code == "invalid-phone-number") {
print("Please enter a valid phone number with country code.");
}
},
);React Native:
try {
await auth().signInWithPhoneNumber("+1 650-555-3434");
} catch (error) {
if (error.code === "auth/invalid-phone-number") {
setError("Phone number format is invalid");
}
}Ensure the Phone authentication provider is enabled in your Firebase project:
1. Go to Firebase Console
2. Select your project
3. Navigate to Authentication → Sign-in method
4. Look for "Phone" in the list
5. If it's disabled (greyed out), click it and toggle "Enable"
6. Click Save
Without enabling the Phone provider, all phone authentication requests will fail.
Rate limiting: Firebase enforces SMS rate limits. If you exceed the quota (usually 15-20 SMS per user per hour during development), requests will be throttled. Use test phone numbers to avoid consuming your SMS quota during development. Some valid phone numbers may still fail if they belong to VOIP services or are known blocklisted numbers. In production, provide users with clear guidance on phone number format and allow them to choose their country from a dropdown to pre-fill the country code. Consider implementing client-side validation with a library like libphonenumber-js before sending to Firebase to catch formatting errors early and improve user experience.
messaging/UNSPECIFIED_ERROR: No additional information available
How to fix "messaging/UNSPECIFIED_ERROR: No additional information available" in Firebase Cloud Messaging
App Check: reCAPTCHA Score Too Low
App Check reCAPTCHA Score Too Low
storage/invalid-url: Invalid URL format for Cloud Storage reference
How to fix invalid URL format in Firebase Cloud Storage
auth/missing-uid: User ID identifier required
How to fix "auth/missing-uid: User ID identifier required" in Firebase
auth/invalid-argument: Invalid parameter passed to method
How to fix "auth/invalid-argument: Invalid parameter passed to method" in Firebase