Skip to content

African Phone Number Formatter

Type a number the way your customer did. You'll get the exact format each payment API wants, plus the likely network, so you can catch "wrong network" errors before they happen.

Number

Any style works: 0772123456, +256 772 123 456, 00256…, 256772123456.

Result

      Which format does each payment API want?

      APIFieldFormatUganda example
      MTN MoMopayer.partyIdCountry code + number, no "+"256772123456
      Airtel Money (direct API)subscriber.msisdnNumber without the country code752123456
      M-Pesa Daraja (Kenya)PhoneNumber, PartyA254 + 9-digit number—
      Paystack mobile moneymobile_money.phoneLocal format with leading 0—
      SMS APIs, databases—E.164: "+", country code, number+256772123456

      Store numbers in E.164 (+256772123456) and convert at the moment you call each API. E.164 is unambiguous, sorts and deduplicates cleanly, and converts to every other format without guessing the country.

      The leading-zero trap

      In most of East Africa and Nigeria, the 0 at the start of a local number is a trunk prefix: you dial it at home but drop it after the country code.0772 123 456 becomes 256772123456.

      In Côte d'Ivoire, Benin and Congo the 0 is part of the number itself. Côte d'Ivoire moved to 10-digit numbers in 2021, so07 01 23 45 67 becomes 2250701234567. Code that always strips a leading 0 breaks every one of these numbers. This formatter knows which countries keep it.

      Supported countries

      CountryCodeDigitsExample → MoMo formatNetworks with mobile money
      Uganda+2569 (after 0)0712345678 → 256712345678Airtel (Airtel Money), MTN (MTN MoMo)
      Kenya+2549 (after 0)0712123456 → 254712123456Airtel (Airtel Money), Safaricom (M-Pesa)
      Ghana+2339 (after 0)0231234567 → 233231234567Telecel (Telecel Cash), at (AT Money), MTN (MTN MoMo)
      Rwanda+2509 (after 0)0720123456 → 250720123456Airtel (Airtel Money), MTN (MTN MoMo)
      Tanzania+2559 (after 0)0621234567 → 255621234567Airtel (Airtel Money), Yas (Mixx by Yas), Vodacom (M-Pesa)
      Zambia+2609 (after 0)0955123456 → 260955123456MTN (MTN MoMo), Airtel (Airtel Money)
      Nigeria+23410 (after 0)08021234567 → 2348021234567Airtel (Airtel Money), MTN (MTN MoMo)
      Cameroon+2379671234567 → 237671234567Orange (Orange Money), MTN Cameroon (MTN MoMo)
      Côte d'Ivoire+225100123456789 → 2250123456789Moov (Moov Money), MTN (MTN MoMo), Orange (Orange Money)
      Benin+229100195123456 → 2290195123456MTN (MTN MoMo), Moov (Moov Money)
      Congo (Brazzaville)+2429061234567 → 242061234567Airtel (Airtel Money), MTN (MTN MoMo)
      Liberia+2317 or 9 (after 0)0770123456 → 231770123456Lonestar Cell (MTN MoMo), Orange (Orange Money)

      Network detection and number portability

      The network is worked out from the number's first digits, using the operator prefix ranges. This catches the most common integration bug: sending an Airtel number to MTN MoMo, which fails with PAYER_NOT_FOUND.

      Several countries let customers keep their number when they switch networks, so a prefix can point at the wrong operator. Use the detected network to warn, pre-select or suggest, but let the customer choose their wallet.

      Frequently asked questions

      What is an MSISDN?

      MSISDN is the telecom name for a mobile phone number in international format: the country code followed by the subscriber number, with no plus sign, spaces or leading zero. For example, the Ugandan number 0772 123 456 is the MSISDN 256772123456.

      What phone number format does the MTN MoMo API expect?

      MTN MoMo expects the payer's partyId as the country code plus the number, digits only, with no "+" and no leading 0, for example 256772123456 in Uganda or 233241234567 in Ghana. In Côte d'Ivoire, Benin and Congo the 0 is part of the number, so it stays: 2250701234567.

      What format does M-Pesa Daraja STK push expect?

      Daraja expects Kenyan Safaricom numbers as 254 followed by the 9-digit number, for example 254712345678, for both PhoneNumber and PartyA. Don't include "+" or the leading 0.

      Can I tell the network from the phone number?

      Usually, from the first digits. But Kenya, Ghana, Nigeria and other countries allow number portability, so a customer can keep their number when they switch networks. Treat the detected network as a hint, not proof, and let customers pick their wallet.

      What format does Flutterwave expect for mobile money?

      Flutterwave's own examples are inconsistent: some show the local format and some include the country code. Test with your Flutterwave account, and keep the E.164 version stored so you can produce either.

      Related

      Number ranges and operator prefixes come from Google's libphonenumber(Apache License 2.0), updated 2026-10-28. API formats checked October 2026.

      Need this built for you?

      I integrate MTN MoMo, M-Pesa and Airtel Money into Laravel / PHP, Python / Django, Node.js / Next.js apps: payments, callbacks, payouts and go-live, with tests.