Last updated:

Address Format Character Counts - Global Formats and Form Design

About a 8-minute read

Addresses differ from country to country in everything from the order of their components to the number of digits in a postal code. Design a form without knowing which component makes the character count grow, and you end up with fields that real addresses cannot fit into. This article breaks a Japanese address apart and counts it, reads the field limits a national postal specification actually defines, and turns both into maxlength values you can defend.

Where the Characters Go - A Japanese Address Measured

The quickest way to see which part of an address drives its length is to take one apart and count it. The table below counts a representative Japanese address element by element, treating each separating space as one character and leaving out the Japanese postal mark.

ComponentExampleCharacters in the exampleNotes
Postal code100-00018 charsSeven digits plus one hyphen, so the length is fixed
Prefecture東京都 / 神奈川県3 chars / 4 chars44 of the 47 prefecture names are 3 characters; only 神奈川県, 和歌山県 and 鹿児島県 reach 4
Municipalityさいたま市浦和区8 charsIn designated cities the city and the ward form one component, which lengthens it
District and block丸の内 1-1-19 charsA space separates the name from the numeric part
Building and roomパークコート赤坂ザ・タワー 1501 号室21 charsOptional, and the most variable component of all

The building name is where the variation lives: パークコート赤坂ザ・タワー is 13 characters on its own and 21 once the room number is attached. Joining every example above with single spaces gives 53 characters. The same address grows when it is romanized for international shipping, because kanji carry far more information per character than Latin letters do. "東京都港区六本木6丁目10番1号 六本木ヒルズ森タワー 49階" is 31 characters in Japanese, while "49F Roppongi Hills Mori Tower, 6-10-1 Roppongi, Minato-ku, Tokyo 106-6149" is 73. A single-line field sized for the Japanese script version truncates the romanized one.

Indian addresses grow for a different reason. Street naming and house numbering are inconsistent in many areas, so addresses lean on landmark references ("near Krishna Temple", "opposite State Bank") and on several levels of locality. "Flat 302, Building A, Sunrise Apartments, Near Krishna Temple, Sector 15, Vashi, Navi Mumbai, Maharashtra 400703" is 112 characters, and a field that truncates at 60 cuts it in half, which makes delivery impossible.

What a Postal Specification Defines - Royal Mail's PAF

Guessing at maximum lengths is unnecessary when a postal operator publishes its own field limits. The Postcode Address File, the address database specification behind UK addresses, defines a maximum length for every element it stores.

ElementDefined maximum
Organisation name / department name60 chars each
Sub building name (Flat 3 and similar)30 chars
Building name50 chars
Building number4 chars
Thoroughfare name / descriptor (Street, Road)60 chars / 20 chars
Dependent thoroughfare name / its descriptor60 chars / 20 chars
Locality names (two levels)35 chars each
Post town30 chars
Postcode7 chars

Note what the specification does not say. The figure of 80 characters that often gets quoted for the street line is a composite of two separate fields, 60 characters for the thoroughfare name plus 20 for its descriptor, and no single field of that size exists. Adding up the 13 fields listed above gives 471 characters. Almost no address fills them all, but the arithmetic sets the ceiling that one free-form line has to respect. "Flat 3, 27 Elm Street, Kensington, London, W8 5DL", an invented address used here only to show the shape, runs sub building name, building number, thoroughfare name, locality, post town and postcode in that order.

Postal Code Formats and Lengths

Postal codes are the most structured part of an address, yet their formats vary enough to break naive validation logic. The lengths below count the separating space wherever the published format includes one.

CountryFormatLengthExampleValidation pattern
JapanNNN-NNNN8 chars (with hyphen)106-6149\d{3}-\d{4}
United StatesNNNNN or NNNNN-NNNN5 or 10 chars90210 or 90210-1234\d{5}(-\d{4})?
United KingdomA9 9AA to AA9A 9AA6-8 chars (with space)SW1A 1AAComplex regex
CanadaA9A 9A97 charsK1A 0B1[A-Z]\d[A-Z] \d[A-Z]\d
GermanyNNNNN5 chars10115\d{5}
BrazilNNNNN-NNN9 chars01001-000\d{5}-\d{3}
IndiaNNNNNN6 chars400703\d{6}
IrelandA99 A9A97 chars (8 with space)D02 AF30Eircode format

The UK postcode is the hardest of these to validate. The format varies from "A9 9AA" (6 characters including the space) to "AA9A 9AA" (8 characters), and the position of the space shifts with the length of the outward code. Many developers skip strict validation and check only for five to seven alphanumeric characters plus an optional space, which is pragmatic but lets invalid codes through. It also helps to know what a full UK postcode resolves to: a group of around ten addresses, or a single delivery point that receives large volumes of mail. A Japanese postal code covers a town-level area instead, which is why the block number and building name remain essential there.

Ireland's Eircode system, introduced in 2015, assigns a code to every individual address rather than to a geographic area. Each code is seven characters: the first three form the routing key that identifies the delivery area, and the remaining four identify the individual address. "A65 F4E2" therefore points at one specific building rather than a neighborhood. The design solves a local problem, since many Irish homes have neither a house number nor a unique street name, but international forms often reject it because they expect purely numeric codes. When you size a postal code field, do not fix it at the seven digits a Japanese code needs - allow around eight characters so that letters and a space fit.

Form Field Design Recommendations

The measurements and the specification limits above are enough to set maxlength values you can justify line by line.

FieldRecommended maxlengthRationale
Address line 1100 charsHolds a PAF thoroughfare name (60) with its descriptor (20) and a building number
Address line 2100 charsSub building name (30) plus building name (50) with separators
City60 charsCompound city names in German, Welsh and Thai fit, and PAF caps a post town at 30
State / Province60 charsSome administrative division names are very long
Postal code15 charsThe longest format in the table above is 10 characters, so this leaves margin
Country60 chars"The United Kingdom of Great Britain and Northern Ireland" is 56 characters

A recurring mistake is setting address line 1 to 40 or 50 characters. That works for many US and UK addresses but fails for romanized Japanese addresses, Indian addresses with landmarks, and Brazilian addresses with complemento details: the 73-character and 112-character examples above both overflow such a field. Setting maxlength to 100 characters costs nothing in terms of database storage (use VARCHAR, not CHAR) and removes a whole class of avoidable failures. For deeper analysis of form validation patterns, see Form Input Validation.

Address Component Order by Country

The order in which address components appear varies by country, and forcing a single order on all users creates confusion.

CountryComponent order (top to bottom)Notable difference
United StatesName, Street, City + State + ZIPState abbreviated to 2 letters
JapanPostal code, Prefecture, City, Street, BuildingLarge-to-small hierarchy, postal code first
United KingdomName, Street, Locality, Town, PostcodeCounty often omitted in modern usage
GermanyName, Street + Number, PLZ + CityHouse number comes after street name
ChinaCountry, Province, City, District, Street, BuildingLarge-to-small, like Japan
BrazilStreet + Number, Complemento, Bairro, City-State, CEPNeighborhood (bairro) is a required field

Japan and China use a large-to-small order (country, then prefecture/province, then city, then street), which is the opposite of the Western small-to-large convention. When Japanese users encounter a form designed for US addresses, they must mentally reverse their address structure. The best practice is to adapt the form layout to the user's selected country, reordering fields to match local conventions. Google's address form library (libaddressinput) provides country-specific field ordering data that can drive this adaptation.

Germany places the house number after the street name ("Friedrichstrasse 43" not "43 Friedrichstrasse"), which trips up parsing logic that assumes the number comes first. Brazil requires a "bairro" (neighborhood) field that has no equivalent in most other countries. These structural differences argue against fixing the meaning of every field country by country. The design that travels furthest is to structure only the country and the postal code, and to take the rest as free-form lines whose order alone is fixed, as "address line 1" and "address line 2". Because no line is tied to a particular component, one form handles countries that put the house number before the street name and countries that put it after, and a single generous per-line limit taken from the specification figures above replaces a tree of country-specific rules. For more on designing forms that handle multilingual text gracefully, see Multilingual Text Length Design.

The Longest Place Names in the World

Some real place names push the boundaries of any character limit. Each count below is of the name as written in the script shown.

PlaceCharacter countCountry
Taumatawhakatangihangakoauauotamateaturipukakapikimaungahoronukupokaiwhenuakitanatahu85 charsNew Zealand
Llanfairpwllgwyngyllgogerychwyrndrobwllllantysiliogogogoch58 charsWales, UK
Chargoggagoggmanchauggagoggchaubunagungamaugg45 charsUnited States
Bangkok's full ceremonial name in Thai script (the everyday name is Krung Thep Maha Nakhon)168 charsThailand (Bangkok)

Bangkok's full ceremonial name runs to 168 characters in Thai script. Nobody uses the full name in addresses - "Bangkok" or "Krung Thep" suffices - but the existence of such names illustrates why hard character limits on city name fields should be generous. The Welsh town of Llanfairpwllgwyngyll (commonly abbreviated) has 58 characters in its full name. A city field with a 30-character limit would truncate it, and truncated place names cause delivery failures.

These extreme cases are rare, but they represent real addresses where real people live and receive mail. A form that cannot accept them is a form that excludes those users entirely. The cost of setting a generous maxlength is zero; the cost of excluding users is real.

Share this article