Parse Nigerian
phone numbers
Zero-dependency TypeScript library with complete network detection, E.164 formatting, and intelligent batch processing.
npm install phoneng Quick Start
Three lines of code
Import, parse, and extract any format. Network detection, validation, and formatting happen automatically.
import { parse } from 'phoneng'
const result = parse('08031234567')
// result.e164 → '+2348031234567'
// result.network → 'MTN'
// result.type → 'MOBILE' Capabilities
Production-ready features
Zero Dependencies
No external packages required. Self-contained and auditable. Ships under 1KB gzipped.
Network Detection
Automatically identify MTN, Airtel, Glo, and 9mobile from phone number prefixes.
TypeScript First
Complete type definitions with discriminated unions for type-safe error handling.
Batch Processing
Process arrays efficiently with aggregated statistics and network breakdowns.
Supported Inputs
Any format in, structured data out
Pass phone numbers in any common format. The parser normalizes input automatically before validation.
08031234567 National with trunk +2348031234567 E.164 format 2348031234567 Compact (no +) +234 803 123 4567 Spaced international 0803-123-4567 Hyphen separated (0803) 123 4567 Parentheses 234-803-123-4567 Country code with hyphens 0803 1234567 Whitespace trimmed Parse Result
Complete output from one call
Every parse returns validation status, multiple formats, and carrier metadata in a single typed object.
valid true e164 +2348031234567 national 08031234567 international +234 803 123 4567 compact 2348031234567 rfc3966 tel:+2348031234567 prefix 0803 network MTN type MOBILE Network Detection
Automatic carrier identification
Every parsed number includes its carrier. Full coverage of all Nigerian mobile operators with accurate prefix mapping.
MTN
0803, 0806, 0813...
Airtel
0802, 0808, 0812...
Glo
0805, 0807, 0815...
9mobile
0809, 0817, 0818...
Interactive
Try it in your browser
Start parsing
in seconds
Install phoneng and add Nigerian phone number parsing to your application today.