Why 0800 Becomes 800: Leading Zeros in Australian Postcodes
Northern Territory postcodes begin with zero, and that zero disappears the moment a postcode is treated as a number. Here is where it happens, what the damage looks like, and the one rule that prevents all of it.

Darwin is 0800. Open a customer list in a spreadsheet and you may find it as 800. Nobody typed it wrongly, nothing rejected it, and the address now carries a postcode that does not exist.
This is the most common way an Australian address is corrupted, and it is entirely avoidable. The cause is always the same: somewhere between the form and the carrier, a postcode was treated as a quantity rather than as a label.
Why the zero is real
The first digit of an Australian postcode identifies the state or territory, and the Northern Territory was given 0. That is not padding and it is not formatting. It is as much part of the code as the 8 that follows it, in the same way the 2 in 2000 is part of Sydney.
A postcode is four characters long, always. 800 is three characters, which is not a valid Australian postcode in any state. What the four digits mean goes through the rest of the structure, but the length rule on its own is enough to see the problem: the moment a code is three characters, something has eaten a character.
Where the zero disappears
The zero is never deleted deliberately. It is lost by conversions that are trying to be helpful, in a handful of places that recur in almost every system.
- A spreadsheet column formatted as a number. Paste 0800 into a general or numeric cell and it is stored as the number 800. The display is the damage: nothing warns you.
- A CSV import. The file holds 0800 as text, the importer guesses the column is numeric because every value looks like a number, and the guess wins.
- A database column typed as an integer, which cannot represent a leading zero at all. The value is narrowed on insert and there is nothing left to recover.
- JSON parsed into a numeric field. A string "0800" survives; an unquoted 0800 does not, and some parsers will read it as octal rather than as eight hundred.
- A form input of type number, which strips the leading zero on the way through the browser before your code ever sees it.
- A report or export that reformats "for tidiness", trimming what looks like an insignificant zero.
Every one of these is a default rather than a decision. That is why the problem is so persistent: nobody chose it, so nobody remembers doing it, and the fix has to be a deliberate choice in the other direction.
What the damage looks like downstream
A broken postcode rarely announces itself. The address still has a suburb and a state, which is usually enough for a human to read, so the order ships and the record survives. The cost appears later and in places nobody connects back to a missing character.
Address validation starts failing for a block of customers who all live in the same territory. Bulk postage is rejected or priced wrongly because the sortation data does not match. Analytics by postcode quietly drop the Northern Territory, or create a phantom code 800 that belongs to nothing. Deduplication stops matching two records for the same household because one has 0800 and the other 800.
The pattern worth noticing is that every symptom lands on the same group of people: the ones whose postcodes begin with zero. A bug that affects one territory more than the rest of the country is hard to see from an average, which is part of why it survives so long.
Storing it so it survives
The database column should be a fixed or variable-length string rather than an integer. In MySQL or Postgres that is a char(4) or a varchar; in MongoDB it is a string; in a spreadsheet it is a column formatted as text before anything is pasted into it, not afterwards.
On the way in, validate against the format rather than against a number: four characters, each one a digit. A regular expression of four digits anchored at both ends does that in one line, and it rejects both the three-character casualty and the five-digit value someone typed because a US form taught them postcodes have five.
In the form itself, use a text input with a numeric keypad hint rather than a number input. A number input strips leading zeros, allows a decimal point and a minus sign, and offers increment arrows for a value that nobody ever wants to increment. A text input with an appropriate input mode gives mobile users the same keypad without any of that behaviour.
When you export, quote the field. A CSV with quoted values tells the next importer that the column is text, which is the only hint most importers will take.
Repairing a column that has already lost its zeros
If you have a column of postcodes where some are three characters long, the repair is mechanical: a three-character value that is otherwise valid is a Northern Territory code missing its zero, and padding it back to four characters restores it.
Do the repair once, change the column type in the same migration, and fix whatever was writing into it. Padding on read, in each query or report that touches the data, leaves the broken values in place and guarantees that the next feature to use the column gets it wrong again.
Two cautions. Pad only values that are genuinely three characters of digits, so you do not invent codes from rows that are empty or hold something else entirely. And check the result against the state on the record: a padded code should start with 0 and belong to a Northern Territory address, and anything that does not fit is a different problem wearing the same costume.
An audit worth running once
If you hold Australian addresses and have never checked for this, the audit takes one query. Count the postcodes that are not exactly four characters, and group them by length. Three-character values are almost always Northern Territory codes that lost their zero; five-character values are usually a US ZIP code typed into the wrong form or a value with a stray space.
Then count how many of your records sit in the Northern Territory according to the state field, and compare that with how many have a postcode starting with zero. If the two numbers disagree, the gap is the size of the problem, and it is usually larger than anyone expects because the damage happens silently at import time rather than at entry.
Run the same check on anything you export. A file that leaves your system with valid codes and arrives at a mailing house with three-character ones has been reformatted in transit, and the spreadsheet in the middle is almost always where it happened.
Checking a code you actually have
If you want to know the postcode for where you are right now rather than untangle a database, the detection tool returns the code covering the position your device reports, with the suburb and state alongside it so you can see at a glance whether it looks right. A four-character answer that begins with zero is the correct answer for the Northern Territory, not something to tidy up.
For the last line of an address, where the postcode sits with the suburb and the state, suburb, state and postcode explains why the three are always written together and what goes wrong when a form tries to derive one from another.
Detect my postcode now Skip the reading — get the postcode for where you are standing.
Detect your postcode from your current location
No typing and no address lookup. Your browser asks for permission, your device works out where it is, and the postcode in Australia comes back in seconds. Nothing is sent until you press the button.
Your location is only used to find your postcode.