UtilityActive
Phone Number Validation
Parse and validate any phone number worldwide using libphonenumber. Returns is_valid, e164 (canonical international format e.g. '+4917612345678'), national_format, country_code (ISO alpha-2), and line_type (MOBILE/FIXED_LINE/VOIP/TOLL_FREE). Provide country_code hint (e.g. 'DE') for local numbers without country prefix.
Input Schema
{
"type": "object",
"required": [
"phone"
],
"properties": {
"phone": {
"type": "string",
"description": "Phone number to validate. Can be in any format: E.164 ('+4915123456789'), national ('015123456789'), or international ('0049 151 23456789'). Include country code (+ prefix) for best results."
},
"country_code": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code hint for parsing national numbers without country prefix (e.g. 'DE' for Germany, 'US' for United States). Optional if number includes country code (+...)."
}
}
}
Output Schema
{
"type": "object",
"required": [
"phone",
"is_valid",
"checks"
],
"properties": {
"phone": {
"type": "string",
"description": "The input phone number as provided"
},
"is_valid": {
"type": "boolean",
"description": "true if the number is a valid, dialable phone number"
},
"e164": {
"type": "string",
"description": "E.164 formatted number (e.g. '+4915123456789'). International standard format."
},
"national_format": {
"type": "string",
"description": "Nationally formatted number (e.g. '0151 23456789' for Germany)"
},
"international_format": {
"type": "string",
"description": "Internationally formatted number (e.g. '+49 151 23456789')"
},
"country_code": {
"type": "string",
"description": "ISO 3166-1 alpha-2 country code (e.g. 'DE', 'US', 'GB')"
},
"country_calling_code": {
"type": "string",
"description": "International dialing code (e.g. '49' for Germany, '1' for US)"
},
"line_type": {
"type": "string",
"description": "Type of phone line: 'MOBILE', 'FIXED_LINE', 'FIXED_LINE_OR_MOBILE', 'TOLL_FREE', 'PREMIUM_RATE', 'SHARED_COST', 'VOIP', 'PERSONAL_NUMBER', 'PAGER', 'UAN', 'VOICEMAIL', or 'UNKNOWN'"
},
"checks": {
"type": "object",
"properties": {
"is_possible": {
"type": "boolean",
"description": "Number has a valid length for the country (faster check than full validation)"
},
"is_valid": {
"type": "boolean",
"description": "Full validation — number is valid for the assigned country and region"
}
}
}
},
"example": {
"phone": "+49 151 23456789",
"is_valid": true,
"e164": "+4915123456789",
"national_format": "0151 23456789",
"international_format": "+49 151 23456789",
"country_code": "DE",
"country_calling_code": "49",
"line_type": "MOBILE",
"checks": {
"is_possible": true,
"is_valid": true
}
}
}