Format

Created by Dariusz Szczendzina, Modified on Wed, 12 Jul, 2023 at 10:44 AM by Dariusz Szczendzina

Format allows you to format emails, phone numbers, postcodes and URL's to a standardised structure.

Formatting refers to the organization of data according to pre-set specifications e.g. making sure an email only has one '@' symbol present.


Email

Input one or more Email Addresses and return them in the correct format (if possible).

For example, you can choose to format email to remove extra '@' symbols or an incorrectly input suffix. E.g.

EmailFormatted Email
example@example.comexample@example.com
example@@example.comexample@example.com
example@example..comexample@example.com

Phone

International

Input one or more International Telephone Numbers and return them in the correct format (if possible).

For example, you can choose to format telephone numbers in the International standard to assign a country code to a telephone number, remove any unnecessary characters and add spacing. E.g.

TelephoneCountry Identifier - ISO 2Formatted Telephone
1234567891GB+44 1234 567891
12.23.34.45.56GB+44 1223 344556
111-222-333-4GB+44 111 222 3334

National

Input one or more National Telephone Numbers and return them in the correct format (if possible).

For example, you can choose to format telephone numbers in the National standard to assign the correct prefix to a telephone number, remove any unnecessary characters and add spacing. E.g.

TelephoneCountry Identifier - ISO 2Formatted Telephone
1234567891GB01234 567891
12.23.34.45.56GB01223 344556
111-222-333-4GB0111 222 3334

E164

Input one or more Telephone numbers along with a country identifier and return them in the E164 standard (if possible).

For example, you can choose to format telephone numbers in the E164 standard to assign a country code to a telephone number as well as remove any unnecessary characters. E.g.

TelephoneCountry Identifier - ISO 2Formatted Telephone
1234567891GB+441234567891
12.23.34.45.56GB+441223344556
111-222-333-4GB+441112223334

RFC 3966

Input one or more Telephone Numbers and return them in the RFC 3966 standard format (if possible).

For example, remove unnecessary and incorrect characters and return them in the desired format. E.g.

TelephoneCountry Identifier - ISO 2Formatted Telephone
1234567891GBtel:+44-1234-567891
12.23.34.45.56GBtel:+44-1223-344556
111-222-333-4GBtel:+44-111-222-3334

Postcode

Input one or more postcodes along with a country identifier and return them in the correct format (if possible).

For example, you can choose to format postcodes to identify misinput characters and remove them. E.g.

PostcodeCountry Identifier - ISO 2Formatted Postcode
P/O1£3 9FUGBPO13 9FU
PO.13 9F.UGBPO13 9FU
P-O-1-3-9-F-UGBPO13 9FU

URL Address

Input one or more URL Addresses along with their prefixes and return them in the correct format (if possible).

For example, remove incorrect characters such as commas or duplicate full stops. E.g.

URL AddressURL PrefixFormatted URL Address
microsoft..comwww.www.microsoft.com
microsoft,,comwww.www.microsoft.com
microsoft,.comwww.www.microsoft.com

Dialling Codes

Below is a selection of dialling codes for reference.

Worldwide

CountryCountry CodeInternational PrefixNational PrefixNational Number
Afghanistan+93009 digits
Albania+355003 to 9 digits
Algeria+213008, 9 digits
American Samoa+1111(684)+7 digits
Andorra+37606, 8, 9 digits
Angola+244009 digits
Anguilla+1111(264)+7 digits
Antigua and Barbuda+1111(268)+7 digits
Argentina+540010 digits
Armenia+374008 digits
Aruba+29707 digits
Australia+611105 to 15 digits
Australian External Territories+672006 digits
Austria+43004 to 13 digits
Azerbaijan+994008 to 9 digits
Bahamas+1111(242)+7 digits
Bahrain+97308 digits
Bangladesh+880006 to 10 digits
Barbados+1111(246)+7 digits
Belarus+37581089 to 10 digits
Belgium+32008 to 9 digits
Belize+50107 digits
Benin+22908 digits
Bermuda+1111(441)+7 digits
Bhutan+97507 to 8 digits
Bolivia (Plurinational State of)+591008 digits
Bonaire, Sint Eustatius and Saba+599007 digits
Bosnia and Herzegovina+387008 digits
Botswana+26707 to 8 digits
Brazil+550010 digits
British Virgin Islands+1111(284)+7 digits
Brunei Darussalam+67307 digits
Bulgaria+359007 to 9 digits
Burkina Faso+22608 digits
Burundi+25708 digits
Cambodia+855001, 00708 digits
Cameroon+23708 digits
Canada+111110 digits
Cape Verde+23807 digits
Cayman Islands+1111(345)+7 digits
Central African Rep.+23608 digits
Chad+23508 digits
Chile+561YZ01YZ8 to 9 digits
China+86005 to 12 digits
Colombia+57005/007/009/555/99903/05/07/098, 10 digits
Comoros+26907 digits
Congo+24209 digits
Cook Islands+68205 digits
Costa Rica+50608 digits
Côte d'Ivoire+22508 digits
Croatia+385008 to 12 digits
Cuba+5311906 to 8 digits
Curaçao+599007 to 8 digits
Cyprus+35708, 11 digits
Czech Rep.+42004 to 12 digits
Dem. People's Rep. of Korea+850006 to 17 digits
Dem. Rep. of the Congo+243005 to 9 digits
Denmark+4508 digits
Diego Garcia+24607 digits
Djibouti+25306 digits
Dominica+1111(767)+7 digits
Dominican Rep.+1111(809/829)+7 digits
Ecuador+593008 digits
Egypt+20007 to 9 digits
El Salvador+50307, 8, 11 digits
Equatorial Guinea+24009 digits
Eritrea+291007 digits
Estonia+37207 to 10 digits
Ethiopia+251009 digits
Falkland Islands (Malvinas)+50005 digits
Faroe Islands+29806 digits
Fiji+67907 digits
Finland+35800/990/994/99905 to 12 digits
France+33009 digits
French Dep. and Territories in the Indian Ocean+26209 digits
French Guiana+59409 digits
French Polynesia+68906 digits
Gabon+24106, 7 digits
Gambia+22007 digits
Georgia+995009 digits
Germany+49006 to 13 digits
Ghana+233005 to 9 digits
Gibraltar+35008 digits
Global Mobile Satellite System (GMSS), shared+881
Greece+300010 digits
Greenland+29906 digits
Grenada+1111(473)+7 digits
Group of countries, shared code+388
Guadeloupe+59009 digits
Guam+1111(671)+7 digits
Guatemala+50208 digits
Guinea+22408 digits
Guinea-Bissau+24507 digits
Guyana+59217 digits
Haiti+50908 digits
Honduras+50408 digits
Hong Kong, China+85214, 8 to 9 digits
Hungary+36068 to 9 digits
Iceland+35407, 9 digits
India+91007 to 10 digits
Indonesia+62001/00805 to 10 digits
Inmarsat SNAC+87009 digits
International Freephone Service+8008 digits
International Networks, shared code+882
International Networks, shared code+883
International Premium Rate Service (IPRS)+9799 digits
International Shared Cost Service (ISCS)+8088 digits
Iran (Islamic Republic of)+98006 to 10 digits
Iraq+964008 to 10 digits
Ireland+353007 to 11 digits
Israel+97200/012/013/01408 to 9 digits
Italy+390up to 11 digits
Jamaica+1111(876)+7 digits
Japan+811005 to 13 digits
Jordan+962005 to 9 digits
Kazakhstan+7810810 digits
Kenya+254006 to 10 digits
Kiribati+68605 digits
Korea (Rep. of)+82001/002/007000/0828 to 11 digits
Kuwait+96507, 8 digits
Kyrgyzstan+996009 digits
Lao P.D.R.+856008 to 10 digits
Latvia+37107, 8 digits
Lebanon+961007 to 8 digits
Lesotho+26608 digits
Liberia+23107 to 8 digits
Libya+218008 to 9 digits
Liechtenstein+42307 to 9 digits
Lithuania+370008 digits
Luxembourg+35204 to 11 digits
Macao, China+85307 to 8 digits
Madagascar+26109 to 10 digits
Malawi+26507, 8 digits
Malaysia+60007 to 9 digits
Maldives+96007 digits
Mali+22308 digits
Malta+35608 digits
Marshall Islands+6921117 digits
Martinique+59609 digits
Mauritania+22207 digits
Mauritius+23007 digits
Mexico+520110 digits
Micronesia+6911117 digits
Moldova (Republic of)+373008 digits
Monaco+37705 to 9 digits
Mongolia+976107 to 8 digits
Montenegro+382004 to 12 digits
Montserrat+1111(664)+7 digits
Morocco+212009 digits
Mozambique+25808 to 9 digits
Myanmar+95007 to 9 digits
Namibia+264006 to 10 digits
Nauru+67404, 7 digits
Nepal+977008 to 9 digits
Netherlands+31009 digits
New Caledonia+68706 digits
New Zealand+64003 to 10 digits
Nicaragua+50508 digits
Niger+22708 digits
Nigeria+234907 to 10 digits
Niue+68304 digits
Northern Marianas+1111(670)+7 digits
Norway+4705, 8 digits
Oman+96807 to 8 digits
Pakistan+92008 to 11 digits
Palau+680117 digits
Panama+50707, 8 digits
Papua New Guinea+67504 to 11 digits
Paraguay+595005 to 9 digits
Peru+51008 to 11 digits
Philippines+63008 to 10 digits
Poland+48006 to 9 digits
Portugal+35109, 11 digits
Puerto Rico+1111(787/939)+7 digits
Qatar+97403 to 8 digits
Romania+40009 digits
Russian Federation+7810810 digits
Rwanda+25009 digits
Saint Helena, Ascension and Tristan da Cunha+24704 digits
Saint Helena, Ascension and Tristan da Cunha+29004 digits
Saint Kitts and Nevis+1111(869)+7 digits
Saint Lucia+1111(758)+7 digits
Saint Pierre and Miquelon+50806 digits
Saint Vincent and the Grenadines+1111(784)+7 digits
Samoa+68503 to 7 digits
San Marino+37806 to 10 digits
Sao Tome and Principe+23907 digits
Saudi Arabia+966008 to 9 digits
Senegal+22109 digits
Serbia+381004 to 12 digits
Seychelles+24807 digits
Sierra Leone+232008 digits
Singapore+65001/002/008/012/013/018/0198 to 12 digits
Sint Maarten (Dutch part)+1111(721) + 7 digits
Slovakia+421004 to 9 digits
Slovenia+386008 digits
Solomon Islands+67705 digits
Somalia+25205 to 8 digits
South Africa+27009 digits
South Sudan+21100
Spain+3409 digits
Sri Lanka+94009 digits
Sudan+249009 digits
Suriname+597006 to 7 digits
Swaziland+26807 to 8 digits
Sweden+46007 to 13 digits
Switzerland+41004 to 12 digits
Syrian Arab Republic+963008 to 10 digits
Taiwan, China+886208 to 9 digits
Tajikistan+9928~1089 digits
Tanzania+255009 digits
Telecommunications for Disaster Relief (TDR)+888
Thailand+66108, 9 digits
The Former Yugoslav Republic of Macedonia+389008 digits
Timor-Leste+67007 digits
Togo+22808 digits
Tokelau+69004 digits
Tonga+67605, 7 digits
Trial of a proposed new international service+991
Trinidad and Tobago+1111(868)+7 digits
Tunisia+21608 digits
Turkey+900010 digits
Turkmenistan+99381088 digits
Turks and Caicos Islands+101(649)+7 digits
Tuvalu+68805, 6 digits
Uganda+256009 digits
Ukraine+380009 digits
United Arab Emirates+971008 to 9 digits
United Kingdom+44007 to 10 digits
United States+111110 digits
United States Virgin Islands+1111(340)+7 digits
Universal Personal Telecommunication (UPT)+878
Uruguay+598004 to 11 digits
Uzbekistan+99881089 digits
Vanuatu+67805, 7 digits
Vatican+379
Vatican+390up to 11 digits
Venezuela (Bolivarian Republic of)+580010 digits
Viet Nam+84007 to 10 digits
Wallis and Futuna+68106 digits
Yemen+967006 to 9 digits
Zambia+260009 digits
Zimbabwe+263005 to 10 digits

United States Area Codes

STATEAREA CODES
Alabama205, 251, 256, 334, 938
Alaska907
Arizona479, 501, 870
Arkansas479, 501, 870
California209, 213, 279, 310, 323, 341, 408, 415, 424, 442, 510, 530, 559, 562, 619, 626, 628, 650, 657, 661, 669, 707, 714, 747, 760, 805, 818, 820, 831, 858, 909, 916, 925, 949, 951
Colorado303, 719, 720, 970
Connecticut203, 860, 475, 959
Delaware302
Florida239, 305, 321, 352, 386, 407, 561, 686, 727, 754, 772, 786, 813, 850, 863, 904, 941, 954
Georgia229, 404, 470, 478, 678, 706, 762, 770, 912
Hawaii808
Idaho208, 986
Illinois217, 224, 309, 312, 331, 618, 630, 708, 773, 779, 815, 847, 872
Indiana219, 260, 317, 574, 765, 812, 930
Iowa319, 515, 563, 641, 712
Kansas316, 620, 785, 913
Kentucky270, 364, 502, 606, 859
Louisiana225, 318, 337, 504, 985
Maine207
Maryland240, 301, 410, 443, 667
Massachusetts339, 351, 413, 508, 617, 774, 781, 857, 978
Michigan231, 248, 269, 313, 517, 586, 616, 734, 810, 906, 947, 989, 679
Minnesota218, 320, 507, 612, 651, 763, 952
Mississippi228, 601, 662, 769
Missouri314, 417, 573, 636, 660, 816
Montana406
Nebraska308, 402, 531
Nevada702, 725, 775
New Hampshire603
New Jersey201, 551, 609, 640, 732, 848, 856, 862, 908, 973
New Mexico505, 575
New York212, 315, 332, 347, 516, 518, 585, 607, 631, 646, 680, 716, 718, 838, 845, 914, 917, 929, 934
North Carolina252, 336, 704, 743, 828, 910, 919, 980, 984
North Dakota701
Ohio216, 234, 326, 330, 380, 419, 440, 513, 567, 614, 740, 937, 220
Oklahoma405, 580, 918, 539
Oregon503, 541, 971, 458
Pennsylvania215, 223, 267, 272, 412, 484, 610, 717, 724, 814, 878
Rhode Island401
South Carolina803, 843, 854, 864
South Dakota605
Tennessee423, 615, 629, 731, 865, 901, 931
Texas210, 214, 254, 281, 325, 346, 361, 409, 430, 432, 469, 512, 682, 713, 726, 737, 806, 817, 830, 832, 903, 915, 936, 940, 956, 972, 979
Utah435, 801, 385
Vermont802
Virginia276, 434, 540, 571, 703, 757, 804
Washington206, 253, 360, 425, 509, 564
West Virginia304, 681
Wisconsin262, 414, 608, 534, 715, 920, 274
Wyoming307

Custom Functions

DQ.FORMAT_EMAIL

The DQ.FORMAT_EMAIL function formats an email. It will return the original input if failed.

Parameters:

email (string), email to be formatted

returns (string), formatted email

DQ.FORMAT_POSTCODE

The DQ.FORMAT_POSTCODE function formats a postcode.

Parameters:

postcode (string), postcode to be formatted

country (string), country identifier, preferred format is ISO2, otherwise the service will attempt to derive country from the input

returns (string), formatted postcode

DQ.FORMAT_TELEPHONE_E164

The DQ.FORMAT_TELEPHONE_E164 function formats a postcode.

Parameters:

telephone (string), telephone to be formatted

country (string), country identifier, preferred format is ISO2, otherwise the service will attempt to derive country from the input

returns (string), formatted telephone

DQ.FORMAT_TELEPHONE_INTERNATIONAL

The DQ.FORMAT_TELEPHONE_INTERNATIONAL function formats a telephone number to international standard (E. 123).

Parameters:

telephone (string), telephone to be formatted

country (string), country identifier, preferred format is ISO2, otherwise the service will attempt to derive country from the input

returns (string), formatted telephone

DQ.FORMAT_TELEPHONE_NATIONAL

The DQ.FORMAT_TELEPHONE_NATIONAL function formats a telephone number to national standard.

Parameters:

telephone (string), telephone to be formatted

country (string), country identifier, preferred format is ISO2, otherwise the service will attempt to derive country from the input

returns (string), formatted telephone

DQ.FORMAT_TELEPHONE_RFC_3966

The DQ.FORMAT_TELEPHONE_RFC_3966 function formats a telephone number to RFC.3966 standard.

Parameters:

telephone (string), telephone to be formatted

country (string), country identifier, preferred format is ISO2, otherwise the service will attempt to derive country from the input

returns (string), formatted telephone

DQ.FORMAT_URL

The DQ.FORMAT_URL function formats a URL.

Parameters:

url (string)URL to be formatted

prefix (string), prefix of the URL

returns (string), formatted URL

Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons

Feedback sent

We appreciate your effort and will try to fix the article