Address Parser & Formatter

Paste addresses that were typed into a single box by hand and get them back split into proper columns of street, town and postcode. Anything the split is unsure about is flagged, so you find out here rather than at the sorting office.

How to use it

Each line is broken into as many as eight parts - flat, building, street, locality, town, county or state, postcode and country - so a field you did not think you needed is there if you want it.

  1. Paste the addresses One per line, or switch to CSV and pick the column that holds them. You can also drop a file on the box instead.
  2. Read the status column Green rows were split with nothing left over. Red rows have something the tool could not settle, and the reason is written out when you open the row.
  3. Fix the doubtful ones Click a red row, correct the boxes by hand and save. Your version is kept and the row turns green.
Full instructions

Addresses in

Or drop a file here

a .csv, .tsv or plain text list · it is read on your own machine

The parts

StatusFlat / unitBuildingStreet LocalityTown or cityCounty or state PostcodeCountryAs it was typed

Click any row to correct it by hand. The filter above also decides what goes into the formatted output, the exports and the printed labels.

Formatted

In depth

Splitting messy one-line addresses into columns you can actually use

An address typed into a single box by a customer is one long string of text. A spreadsheet, a mail merge or a shipping label wants it as separate fields. This article explains how the tool pulls the postcode, the country, the state, the town and the street out of that string, why some rows come back marked for a human to check, and how to put the parts back together in the layout you need.

Why a single box causes so much trouble later

Most sign-up forms ask for an address in one wide box. It is quick for the person filling it in and it never rejects a valid address, which is why so many forms are built that way. The trouble starts the day somebody needs those addresses as data rather than as text.

A shipping label wants the town on its own line. A spreadsheet report wants to count customers by county. A mail merge wants a field it can drop into a letter. None of those jobs can be done with one long string, so somebody sits down with the list and starts cutting it up by hand. On a list of forty that takes an afternoon. On a list of four thousand it never happens at all.

This tool does the cutting. You give it the text, it gives you eight named columns, and it tells you which rows it was not confident about so you can look at those rather than all of them.

The eight columns and what belongs in each

Flat or unit holds anything inside a building: Flat 4, Apt 3C, Suite 500, Level 3, Room 12. Building holds either the number on the door or the name of the property, so 22 and The Old Rectory both live here. Street holds the thoroughfare on its own, without the number.

Locality is the district, village or neighbourhood that sits between the street and the town. Chiswick in a London address, Indiranagar in a Bengaluru one. Plenty of addresses have nothing here at all, and that is normal.

Town or city is the post town. County or state is the wider area: a county in the United Kingdom and Ireland, a state in the United States, India and Australia, a province in Canada. Postcode and Country finish the set.

Splitting the number away from the street name is deliberate. They are two separate pieces of information and plenty of systems need them apart. When the address is put back together the number is joined onto the front of the street again, so nothing is lost by keeping them in different columns.

Why the postcode is found first

The tool reads each address from the end backwards, and the first thing it looks for is the postcode. This sounds like an odd place to start, but a postcode is the only part of an address with a shape a computer can recognise on sight.

A United Kingdom postcode is one or two letters, a digit, sometimes another character, a space, then a digit and two letters. The letters allowed in each position are restricted, which is why a Canadian code like V6E 4R2 is never mistaken for a British one: V cannot begin a British postcode. Canadian codes alternate letter, digit, letter, digit, letter, digit. Irish Eircodes are a letter, two digits, then four more characters. Each of these shapes is distinctive enough to be trusted.

Once the postcode has been found and lifted out, the line that remains is shorter and much easier to work with. The country usually sits just after the postcode and the state just before it, so pulling those off next takes very little guessing.

United States ZIP+4 codes are matched before plain five-digit ZIPs, for a small but important reason. If the shorter shape were tried first it would match the first five digits of 10118-0110 and quietly throw the last four away.

The problem with postcodes that are only digits

Not every postal system uses letters. A United States ZIP is five digits, and so is a postcode in Germany, France, Spain, Italy and Finland. An Indian PIN code is six digits, and so is a postcode in Russia, Singapore and China. Australian postcodes are four digits, as are New Zealand, Swiss, Austrian and Danish ones.

So a run of digits at the end of a line tells you almost nothing on its own. If the tool simply assumed that five digits meant America, a French address would come back labelled as American, and the person exporting the list would never know.

Instead the tool looks for something else in the line that agrees. The country written out in words counts. So does a state or province name, because Karnataka only exists in India and Victoria only appears in an Australian address. If either is present, the digits are accepted with confidence.

If neither is present, the row is marked. The address is still split, the digits are still kept as the postcode, and a best guess is still offered. It is simply flagged as a guess, with a note saying which other countries use that shape.

There is also a setting for when you already know. If your whole list is Australian, set the country dropdown to Australia and every four-digit postcode is accepted without complaint.

Finding the street among the other pieces

Once the postcode, country and state have gone, what remains is usually two to four pieces separated by commas. One of them is the street. The tool finds it by looking for a word that ends a street name.

The list is long and deliberately not limited to English. Street, Road, Avenue, Lane, Drive, Close, Crescent, Terrace, Boulevard, Highway and Parkway are all there. So are Marg, Nagar, Cross, Colony, Sector, Layout and Chowk, because an address tool that only knows British and American street types is useless across most of Asia.

Some words are weaker signals than others. Park, Green, Common, Gardens, Hill and Bank can all end a street name, but they end the name of a building or an estate far more often. So these only win if nothing stronger is present. Given "Kilcarbery Business Park, Nangor Road", the road wins and the park becomes the building name. Given a piece that starts with a number and has no street word at all, the number is taken as the giveaway.

Whatever sits in front of the street becomes the building. Whatever sits behind it becomes the locality. If no piece looks like a street at all, nothing is called a street. "Andheri West, Mumbai" is a district and a city, and labelling the district as a street would be inventing information that is not there. The row is flagged instead.

What happens when there are no commas at all

Commas are worth more than people realise. "221B Baker St London NW1 6XE" contains exactly the same words as the version with commas, but with nothing marking where one part ends and the next begins.

Here the street word is the only clue available. The tool cuts the line just after it, so "221B Baker St" becomes the address and "London" becomes the town. Compass directions after a street word are kept with the street, which is why "1600 Pennsylvania Avenue NW Washington" splits correctly rather than putting NW in the town.

The method works when one word follows the street. When two or more follow, it stops working. "Chiswick London" is a district and a city; "New York" is a single city. Nothing in the text distinguishes them. Rather than pick one and hope, the tool keeps the whole lump as the town and marks the row so you can split it yourself.

If your source data has commas, keep them. If you are exporting from another system and have a choice, choosing the format with commas will save you a great deal of correcting later.

The flags, and correcting a row by hand

Every row gets a status. Green means the address was split with nothing left over and nothing in doubt. Red means something could not be settled.

The reasons are written out in plain words when you open the row. No postcode found. The postcode is digits only, so the country is a guess. Written without commas, so where the town starts is a guess. No town or city found. Only two parts could be filled in. Some of the text could not be placed.

That last one deserves an explanation. After splitting an address the tool counts the letters and digits in all eight columns and compares them with the letters and digits in the original line. If the columns are short of anything, a word went missing somewhere, and the row is flagged. This is a safety net rather than a rule about addresses. It exists because a silently shortened address is the worst possible outcome: nobody notices until the post comes back.

Click any row and it opens in a form with the eight boxes filled in. Correct whichever ones are wrong, press save, and the row turns green. Your version is remembered against that exact piece of text, so it survives a reload and is reapplied automatically if the same address turns up again in a later batch. If you change your mind, undo puts the tool's own answer back.

The filter at the top of the table can narrow the list to just the flagged rows, which is usually how you want to work through a batch. The same filter also decides what goes into the formatted output and the exports, so you can deliberately export only the rows that need attention.

Putting the parts back together three ways

Splitting is only half the job. The layout dropdown offers three ways to reassemble what has been split.

A postal block is the envelope layout: each part on its own line, ready to print or paste into a label template. One line each puts everything back on a single row with a separator of your choosing, which is what a mail merge field usually wants. CSV columns produces a proper comma separated table with a heading row, the status, any warnings and the original text kept alongside.

The postal block follows the local convention for each address rather than one house style. A British block puts the town, then the county, then the postcode on its own line. An American one puts the city, state code and ZIP on one line: New York, NY 10118. A Canadian block puts the city, then the two-letter province, then the postal code after two spaces, which is what Canada Post asks for. An Indian block joins the postcode to the city with a dash and puts the state on the line below. An Australian one runs the suburb, the state code and the postcode together on one line.

The country line has its own setting. Post staying inside the country should not carry a country line, post going abroad must. Tell the tool which country you are posting from and it works out which addresses need one.

Capital letters and what postal services ask for

Royal Mail asks for the last two lines, the post town and the postcode, in capitals. The United States Postal Service prefers the whole address in capitals. Plenty of address lists arrive in a mixture, or entirely in lower case because somebody typed them on a phone.

The capitals dropdown gives three choices. Leave them as typed changes nothing. All capitals shouts everything, which is what the postal services prefer. Capitalise each word tidies up a list that arrived in lower case.

Capitalising each word is a rough helper rather than a perfect one. It knows to leave a postcode alone, because W4 2PN must not become W4 2pn. It knows that 3rd and 5th are ordinals rather than codes, so they do not come out as 3RD and 5TH. It knows that small words like of and the stay lower case in the middle of a name, and that PO in PO Box stays in capitals. It will still get an unusual name wrong now and then, so give the result a glance before printing.

Working from a CSV, and getting one back

Addresses rarely arrive on their own. They usually sit in a spreadsheet next to a name, an order number and a dozen other columns.

Switch the input to CSV and paste the whole file, or drop it on the box. The tool reads the heading row and offers every column by name, so you pick the one holding the address and ignore the rest. There is also an option to join every column together, which is useful when the address itself has been spread across several columns already.

The CSV that comes back has the eight parts as separate columns, plus the status, the list of warnings, a ready-made single-line version, and the original text exactly as it went in. Keeping the original matters: it is what lets somebody check a suspicious row months later without having to find the source file again.

There is a JSON export too, for feeding into something else, and a printable sheet that lays each address out as a label in its own box, two to a row. That sheet exists for checking a batch against a stack of envelopes, which is still the fastest way to catch an address that came out wrong.

What this tool does not do

It does not check that an address exists. Knowing that a postcode really does belong to a particular street means comparing it with the postal service's own address file, and there is no way to do that without sending your list to somebody else's computer. That is exactly what this page is built not to do.

It does not correct spelling, expand abbreviations to a postal standard, or work out which of two similar addresses was meant. It splits what you give it and puts it back together in the shape you asked for.

It has full rules for six postal systems: the United Kingdom, the United States, India, Canada, Ireland and Australia. About a hundred other country names are recognised when they are written on the line, and those addresses are still split into columns, but their postcode is kept exactly as typed and the envelope block uses a general layout rather than that country's own.

Two letter codes are a known trap. CA at the end of a line is read as California, not Canada, and IN is read as Indiana, not India. In a real list of addresses the state reading is right far more often. Write the country out in full and it is picked up without trouble.

Why none of this leaves your machine

A list of addresses is a list of where people live. It is the most sensitive ordinary data most small organisations hold, and pasting it into a website is a genuinely bad idea.

Everything here happens in the browser on your own device. No address is uploaded, no lookup service is contacted, and nothing is written to any server. You can disconnect from the internet after the page has loaded and every part of the tool still works, which is the simplest way to prove the claim rather than just read it.

Your addresses, your settings and every correction you have made are kept in this browser alone, so the work survives a reload or an accidental closed tab. The start over button empties all three at once when the job is done.

Help

One box of text in, eight named columns out

Each line is broken into as many as eight parts - flat, building, street, locality, town, county or state, postcode and country - so a field you did not think you needed is there if you want it. What comes back can be an envelope block, a single line, or CSV columns, depending on whether you are printing it, storing it or importing it somewhere.

Paste the addresses

One per line, or switch to CSV and pick the column that holds them. You can also drop a file on the box instead.

Read the status column

Green rows were split with nothing left over. Red rows have something the tool could not settle, and the reason is written out when you open the row.

Fix the doubtful ones

Click a red row, correct the boxes by hand and save. Your version is kept and the row turns green.

Choose the layout

An envelope block for printing, one line each for a mail merge, or CSV columns for a spreadsheet.

Take the result

Copy it, download it as CSV or JSON, or print the labels sheet with each address in its own box.

A guess is marked, never hidden

Five digits on their own are a United States ZIP code and also a postcode in Germany, France, Spain and Italy. Six digits are an Indian PIN code and also Russian, Singaporean and Chinese. When nothing else in the line settles it, the row is marked for you to check rather than quietly given a country it may not belong to.

Good to know

Commas are worth a great deal

An address with commas between its parts splits far more reliably than the same address without them. If your source has them, keep them.

It knows six postcode shapes

United Kingdom, United States including ZIP+4, India, Canada, Ireland and Australia. Other countries are recognised by name when the name is written on the line, and their postcode is kept as it was typed.

Nothing is thrown away

Any words that cannot be placed go into the locality box rather than vanishing, and a letter count against the original raises a flag if anything went missing anyway.

Fixes stick to the text

A correction is remembered against the exact address you corrected, so it survives a reload and is reapplied if the same address appears again.

Customer lists stay on your machine

Nothing is uploaded and no lookup service is contacted, which is the whole reason to use a page like this on a list of real people.

Capitals are a choice

Royal Mail and the USPS both prefer the last lines in capitals. Set the capitals dropdown once and it applies to every address at the same time.

Common questions

How does it know which part is the street?
It looks for a word that ends a street name, such as Street, Road, Avenue, Lane, Marg or Cross. Words that could just as easily end the name of a building, like Park or Green, only win if nothing stronger is present, so in “Kilcarbery Business Park, Nangor Road” the road is the street and the park is the building.
Why is a row marked red when it looks fine to me?
Open it and the reason is written out. Common ones are no postcode at all, a postcode that is only digits with nothing to say which country it belongs to, an address written without any commas, or fewer than three parts filled in.
Will it fix a spelling mistake or check that the address is real?
No. It splits what you give it and puts it back together. Checking that a postcode belongs to a street needs the postal service's own address file, and that means sending your list to somebody else, which this page never does.
What happens to an address with no commas in it?
It is split at the street word instead. That works well when one word follows, as in “Baker St London”, but when two or more follow there is nothing in the text to say where the district ends and the city begins, so the row is marked for you to check.
Can it handle a country it does not know?
Yes, as long as the country name is written on the line. About a hundred country names are recognised. The parts are still split, the postcode is kept as typed, and the envelope block uses a general layout rather than that country's own.
Why did it put the house number in the building column?
Because a number and a street name are two different pieces of information, and separating them is the point of the exercise. When you format the address again the number is joined back onto the front of the street.
Do my corrections and settings survive closing the tab?
Yes. The addresses, the layout settings and every fix you have made are kept in this browser only. Start over empties all three.
How many addresses can it take at once?
Two thousand in one go. Beyond that the table itself becomes hard to work with, and a list that long is better split into batches you can actually review.
Is CA California or Canada?
California. The same goes for IN, which is read as Indiana rather than India. A bare two-letter code sitting at the end of a line is a state far more often than a country, so those two are deliberately left to the state matcher. Write the country out in full and it is picked up.