Split Addresses in a CSV into Columns
Operator: Abdulla Al Fahad. How tools are built and checked
In a typical customer export, "456 Oak Avenue Apt 4B, Austin, TX 78701, USA" sits in one cell: street, flat number, city, region and postcode run together. That is fine for a label printer and useless for anything else. You cannot filter by state, sort by postcode, deduplicate on street or load the list into a CRM that expects separate fields. This tool takes the pattern-rule route instead of a reference database of streets: it reads how addresses are written in the US, UK, Canada, Australia and the common European layouts.
That makes it fast and private to run on a long list, and it also defines what it can and cannot do. It splits what is written; it does not check that the street exists, correct a misspelled city or fill in a missing postcode. Every row therefore gets a confidence score, a status of parsed, review or unparsed, and a note saying what was guessed, so the awkward rows come out of the pile instead of hiding in it. It is not the same as the Address Label Maker, which prints labels from fields you already have.
Key features
- Rule sets for US, UK, Canadian, Australian and generic European addresses, chosen per file or detected per row
- Ten appended columns: number, street, unit, city, state or region, postcode, country, confidence, status and notes
- A confidence score from 0 to 1 built from which parts were found, with parsed (0.85 or more), review and unparsed statuses
- Notes in plain words: city split by street-type heuristic, extra text ignored, format not recognised, country inferred
- Country filled in for US, UK, Canadian and Australian formats, written as a name or a two-letter code
- Postcodes normalised (SW1A 2AA, K1A 0B1) and all-capitals addresses converted to normal case
- A single-address test box that shows the split live as you change the format
- Download everything, or only the rows that need review, as CSV or XLSX with amber and red status colouring
- Chunked processing with a progress figure and a Cancel button for lists of 100,000 rows or more
How each address format is read, and where the rules stop
Load a CSV, TSV or XLSX of up to 25 MB and 300,000 rows, pick the column that holds the address, and choose a format or leave it on detect. Line breaks inside a cell are treated as commas, so a two-line address from a form export reads the same as a one-line one. The result is your original columns followed by ten new ones: Street number, Street, Unit, City, State / region, Postcode, Country, Parse confidence, Parse status and Parse notes. If a column with one of those names already exists, the new one gets a number in brackets rather than overwriting it.
United States: a trailing ZIP (five digits, or ZIP+4) is taken off first, then a state abbreviation or a full state name, including DC, the territories and the military codes AA, AE and AP. Canada: the postal code pattern (letter-digit-letter, digit-letter-digit, with the six letters that are never used excluded) and the thirteen province and territory abbreviations or names. Australia: a four-digit postcode, accepted when a state abbreviation such as NSW or VIC sits in front of it, plus the full state names. United Kingdom: the standard postcode shape from M1 1AA to SW1A 2AA and the special GIR 0AA, with the last comma-separated part treated as the post town and an optional county or nation recognised from a list of about sixty-five.
Europe has no single layout, so the generic European mode makes two assumptions: the postcode comes before the city (10115 Berlin) and the house number comes after the street name (Hauptstraße 12). It recognises the Dutch four digits and two letters, the Portuguese 1100-053, the Polish 00-238, the Swedish 111 21, the Irish Eircode and plain four- or five-digit codes, with an optional province in capitals after an Italian city (Milano MI). French addresses, where the number comes first, work because the parser tries both positions. The country is read from the last part of the address when it names one of about twenty countries, in English or the local name (Deutschland, Italia, Schweiz).
Within the street line the parser pulls out the unit (Apt, Suite, Unit, Flat, Floor, Level, Room, Lot, Shop, Office or a # sign, plus the 2nd Floor form), reads a leading house number such as 221B, 15-17 or 123 1/2, treats 5/12 George Street as unit 5 at number 12 in Australia and the UK, and keeps PO Box addresses as a street with no number. When the whole address has no commas, the city is split off at the last street-type word (Street, Avenue, Road, Boulevard, Way, Terrace and about seventy more, plus a trailing N, SW or similar direction), and that guess is flagged.
How it works
Each address goes through the same sequence. Newlines and semicolons become commas, the country is stripped from the end if the last words name one, and the format is set from your choice or detected. Detection tries the most specific patterns first: a UK postcode, a Canadian postal code, a ZIP preceded by a valid state, an Australian state followed by four digits, then European postcode shapes in any part after the first.
The tail of the address is then peeled off by format: postcode, then state or region. What is left is split on commas. With two or more parts the last is the city and the earlier ones are street lines; with one part the street-type heuristic decides where the street ends. Street lines are checked for a PO Box, then a unit, then a number. A part that is only a unit (Suite 7700) is consumed as the unit; a part with a digit or street-type word becomes the street; anything else, such as a company name above the street, is reported as not used.
Confidence adds fixed weights for what was found: street 0.25, a number (or a PO Box) 0.20, city 0.20, postcode 0.20, and region 0.15 where the format expects one. It subtracts 0.10 for a heuristic city split and 0.15 for ignored text, and it is capped at 0.5 when no format was recognised and at 0.7 when no postcode or state anchored the tail. The thresholds are 0.85 for parsed and 0.5 for unparsed, and a row with no street is always unparsed.
Common use cases
- Preparing a donor or customer list for a mail merge that needs separate city, state and ZIP fields
- Sorting a supplier list by postcode region to plan delivery routes, with the UK outward code in its own sort
- Loading a CRM import template that rejects a single address line
- Triaging a messy export: 9 of 12 sample rows parse cleanly, 2 need a look and 1 ("Somewhere near the old mill") is rejected outright
How to use this tool
- Upload the file (or click Load example) and choose the address column. The tool guesses it from names such as address, addr or location.
- Set the address format. Use a country when the whole list is one country, because it removes the guessing; use detect for mixed lists.
- Try a tricky address in the test box and watch the fields change as you switch formats.
- Click Split addresses and wait for the progress to finish. Read the three counts, then filter the table to rows to review.
- Download the full file, or just the rows to review, fix those by hand and merge them back by row number.
Example
Three rows from a customer list, format on detect
id,address
1,"456 Oak Avenue Apt 4B, Austin, TX 78701, USA"
2,"Flat 2, 14 Rosebery Road, Reading, Berkshire RG1 5AB"
3,"1 Infinite Loop Cupertino CA"Appended columns
1 456 | Oak Avenue | Apt 4B | Austin | TX | 78701 | United States | 1.00 | parsed
2 14 | Rosebery Road | Flat 2 | Reading | Berkshire | RG1 5AB | United Kingdom | 1.00 | parsed
3 1 | Infinite Loop | | Cupertino | CA | | United States | 0.70 | review
note: City split from the street line at the last street type word; check it.Tips for best results
- Choose the country format whenever the list is single-country. In detect mode a US address with no state or ZIP has nothing to anchor on and drops to a generic parse at confidence 0.5.
- Sort the output by Parse confidence and fix from the bottom. The review rows cluster around a few causes, so one pattern of fix often covers dozens of rows.
- Country inference is on by default for the four English-speaking formats. Turn it off if the file really mixes countries and you do not want a guess in that column.
- For European lists, check the number position on a few rows. The parser tries both ends, but a street name that itself ends in a number (a numbered avenue) will be read as the house number.
- Leave the original address column in the file. The notes column refers to what was in it, and you will want it when you reconcile the review rows.
Common pitfalls
The rules read the form of an address, not its truth. Nothing here checks that a street exists, that the ZIP belongs to the city or that the postcode is real, so do not use the status as a validity check.
Cities that contain a street-type word (Park Ridge, Green Bay, Mount Vernon) can be cut wrongly when the address has no commas. Those rows are flagged review, not parsed, for exactly this reason.
A US address with a state name that is also a city (Washington, New York) and no comma before the ZIP can lose its city, because the state name is matched first.
UK localities are not post towns. In "10 Downing Street, Westminster, London SW1A 2AA" the last part, London, becomes the city and Westminster is reported as not used.
Rural, numbered-highway and grid-style addresses (N123 W456 Road, County Road 12, Lot 5 off Route 9) are only partly recognised. Expect review flags rather than silent errors.
Common errors and how to fix them
- Most rows come out as "Format not recognised"
- The list has no state, ZIP, postcode or country to anchor on. Pick the country format in the dropdown instead of detect, and the same rows usually reach 0.7 or higher.
- The city column holds part of the street
- The address had no commas, so the split used the last street-type word. Add commas in the source if you can, or fix the flagged review rows; the note says it was a heuristic.
- The file is rejected or truncated
- Files over 25 MB are refused and only the first 300,000 rows are read. Split the file by date or region and run each part.
Best practices
- Run a 200-row sample first, read the review rows and decide whether the country dropdown or a pre-cleaning step fixes the pattern, then run the full list.
- Treat parsed as likely correct and review as a to-do list, never as errors: most review rows are right but involved a judgement call.
What the 40-address test set did and did not show
While the rules were being built they were run against a hand-made set of 40 addresses covering US, UK, Canadian, Australian and ten European layouts, including units, PO boxes, all-capitals input, multi-line cells and a company name above the street. 39 of the 40 came out with every field correct; the one difference was the Westminster, London case above, where the post town convention picks London. Thirty-four were marked parsed and six review.
Treat that as a smoke test, not a benchmark. The set was written alongside the rules, so it flatters them. Real exports bring typos, abbreviations nobody planned for, phone numbers pasted into the address cell and countries the tool does not know. The confidence score exists because accuracy on your file will be lower than that figure and you need to see where.
Frequently asked questions
Does this verify that an address is deliverable?
No. It splits the text into fields using pattern rules. Verification needs a postal reference database, which a browser tool without a server cannot hold. Use the split fields as clean input for a verification service if deliverability matters.
Why is the country blank for some European rows?
When the address does not name a country, a four- or five-digit postcode could belong to several of them, so the tool applies the generic European layout and leaves the country empty rather than guess.
Can it split an address that is already spread over several columns?
Not directly. It reads one column. If street, city and postcode are already separate, you do not need it; if they are partly separate, join the pieces into one column first and run the split.
What does a confidence of 0.85 mean?
It is a rule-of-thumb score, not a probability. It means the street, a number, a city, a postcode and (where the format expects one) a region were all found with no heuristic guess and no ignored text. At 0.85 or more a row is labelled parsed.