← All posts

ASCII vs EBCDIC: the format war you never knew happened

ASCII vs EBCDIC: the format war you never knew happened

Have you ever opened a file that came off an old mainframe and found a wall of ÈÅÓÓÖ where your text should be? I have, and here's the thing — it's not corruption. It's a war wound. Because for decades the computing world ran on two alphabets: the one you know, ASCII, and the one IBM built because it could, EBCDIC. Say that name out loud. EBCDIC. It sounds like a washing machine cycle, and the character encoding war it fought was quieter than the cold war, lasted longer than most people's careers, and parts of it are still being fought in a bank vault near you. This is the ascii vs ebcdic story — the format war you never knew happened.

1964: the alphabet IBM built because it could

April 1964, as far as I remember. IBM rolls out System/360 — the line of mainframes that would run the world's banks, airlines, and governments for the next half century. And with it comes a brand-new character code. Not the one everyone else was drifting toward — IBM's own.

Let me back up, because this needs a translation. A character code is just the agreement that turns "A" into a number, so a machine can store it, sort it, send it. IBM already had one: BCDIC, a six-bit code from the 1401 era — sixty-four slots, and the 1401 made do. But System/360 wanted more: upper and lower case, all the punctuation, room to grow. So IBM's engineers built an eight-bit code — two hundred fifty-six slots, every single one used — and called it EBCDIC, for Extended Binary Coded Decimal Interchange Code. Roll that name around in your mouth. It's an engineering document wearing a tuxedo.

Here's where it gets weird. Why build a rival at all, when ASCII was sitting right there? Because IBM was the biggest kid in the playground, and it had a century of machinery to stay compatible with — telegraphs, punch cards, card sorters. ASCII was a committee's answer, designed for everyone. EBCDIC was one company's answer, designed for itself. It's the difference between agreeing on a common language and building a fence around your own yard. Which is fine, right? Plenty of standards start that way. What nobody predicted was that the fence would hold for sixty years, that this IBM encoding battle would outlive its own machinery, and that the EBCDIC history textbooks skip would decide who gets to talk to whom.

I'll tell you what this felt like in practice. My first job touched a system that talked to a mainframe over a link — I don't remember which vendor's software it was, and I'm not going to name names — and for the first week I was convinced the pipe was broken, because every field I typed came back as symbols. It wasn't broken. The mainframe was spelling my words in EBCDIC and the gateway was doing its best, which was not quite good enough. That's when I learned the golden rule of that era: never trust a text file until you know which alphabet it thinks it's in.

The alphabet with holes in it

Now the part that made mainframe programmers cry into their punch cards: EBCDIC's letters are not in a row. In ASCII, A through Z sit one after another — sort the bytes, you've sorted the alphabet for free. In EBCDIC? A through I live at C1 to C9. Then a gap. J through R live at D1 to D9. Then another gap. S through Z live at E2 to E9. There are empty slots where J and S should be, and they are not empty by accident.

Think of it as a street where the house numbers jump from 9 to 21, because the builder kept reserving plots for shops that never opened. The gaps are reserved for a past that didn't arrive. IBM's engineers were building on the punched card: in the old Hollerith card code, letters were split across three zone rows — A to I in zone twelve, J to R in zone eleven, S to Z in zone zero. EBCDIC mapped those zones straight onto byte values, so sorting EBCDIC bytes gave you exactly the order a physical card sorter produced. It was compatibility with a machine that was already half-obsolete — and it froze a weird alphabet into the most powerful computers on Earth.

And the ascii vs ebcdic difference isn't cosmetic — it changes how data behaves. In ASCII, a dictionary sort is trivial: uppercase, then lowercase, then digits, all in order. In EBCDIC, lowercase letters sit at 81 to A9 — so a lowercase "a" sorts BEFORE an uppercase "A", and digits live at F0 to F9, sorting after every letter in the book. Imagine a phone book where "smith" comes before "Smith" and every number comes after every name. That's what mainframe programmers dealt with for decades, writing collating routines by hand, one character at a time, because the alphabet itself refused to cooperate.

There's a detail that makes me smile every time: the old conversion tables. Every big-iron shop had one pinned to the wall — a grid of 256 cells with both codes side by side — because nobody could keep the mapping in their head. It was the Cold War map of the computing world: two alphabets, one wall chart, and you'd better know which side of it you were on before you opened a file. The ascii vs ebcdic split wasn't an abstraction in those rooms; it was a physical object you could point at while someone explained why your data looked like a ransom note.

The war: how the internet picked a side in the ascii vs ebcdic fight

So now you have two alphabets, and the 1970s happen. Here's the thing: this fight wasn't decided in a boardroom. It was decided by where the computers went.

ASCII spread like it was free — because it basically was. The minicomputers, DEC's PDP machines, Unix growing up in Bell Labs, then the ARPANET standardizing on ASCII with RFC 20 in 1969. Every machine that could talk to the network spoke ASCII. And the mainframe? EBCDIC. So the moment a mainframe wanted to talk to the rest of the world, it needed a translator standing at the door — and the translations were where the IBM encoding battle got bloody.

Let me show you how dumb this gets. In ASCII, the @ sign is byte 0x40. In EBCDIC, byte 0x40 is a SPACE. And EBCDIC's own @ lives at 0x7C, which in ASCII is a vertical bar. So an email address crossing the boundary could arrive as "user|host", or with its @ swapped for a space. The newline is different too: ASCII ends lines with line feed and carriage return; EBCDIC has its own "new line" control at 0x15. Every text file that crossed the border had to be translated character by character, line by line, through hand-written tables — and every table was a place where something could go quietly, permanently wrong. I've seen log files from those gateways that read like abstract art.

Here's the analogy that stuck with me: imagine two countries that speak the same language but spell every word differently, and can't agree on where sentences end. You can translate — but you need a dictionary at every border crossing, and every dictionary is written by hand, and every dictionary gets a little bit wrong. That's the whole fight in a nutshell: not one big problem, but thousands of tiny ones, each big enough to eat a Tuesday.

That's the character encoding war, in one sentence: ASCII won because it was everywhere, and EBCDIC lost because it was inside the biggest machines on Earth — but those machines were so big, and so full of data, that the loser never actually went away.

The fortress that never fell

Here's the part people don't believe: EBCDIC is still alive. As far as I remember, IBM's z/OS still treats EBCDIC as native for a lot of its data. Bank records, insurance policies, airline reservations, government systems — billions of records, sitting in a code with holes in its alphabet. When that data leaves the fortress, it gets translated through code pages — 037, 1047, a whole zoo — and the translation is invisible to you, because the tools do it in a heartbeat. iconv, a Python one-liner, the FTP server in ASCII mode: every one of them is a diplomat at the border.

Why should you care? Because if you've ever exported a statement from a bank, pulled a legacy feed from an airline, or touched a data dump from an old COBOL system, you've stood in front of EBCDIC without knowing it. And there's one quirk that still catches people: zoned decimal — the purest ascii vs ebcdic culture shock there is. Mainframes store numbers as EBCDIC digits with a marker nibble — a "1" is literally the byte 0xF1 in the file, so a column of numbers looks exactly like text. COBOL reads it as arithmetic; a modern script reads it as a string of characters. That mismatch has eaten more than one analyst's afternoon, and it's the strangest chapter of EBCDIC history that nobody puts in the textbooks.

Scale is the part I can't wrap my head around. We're not talking about a few thousand files. We're talking about the accumulated records of half a century of banking, insurance, and air travel — and most of it was born as EBCDIC and only ever leaves the fortress in translation. Somewhere right now, a nightly batch job is converting millions of records so a modern dashboard can read them. The ascii vs ebcdic story isn't a history lesson; it's a job that still gets done every night, quietly, in data centers you'll never visit.

For the rest of us, the treaty is signed. The ascii vs ebcdic character encoding war ended with a whimper, in the form of compatibility layers, and ASCII's first 128 slots got absorbed into Unicode — so everything you type today is a direct descendant of the winner. The whole palette of the text pixel art guide still runs on those 95 printable slots, the winner's alphabet. But the loser's alphabet never surrendered; it just retreated behind the bank's firewall.

So next time your editor shows you a wall of ÈÅÓÓÖ, don't close the file in disgust. You're looking at the other side of the ascii vs ebcdic war, still in uniform, still on duty, sixty years after the shooting stopped.

And it makes me wonder — if IBM had won, what would the internet look like? Would email even work, with @ meaning space? Would sorting ever have been fixed? I honestly don't know. What I do know: standards don't win because they're better. They win because they're everywhere. ASCII was the alphabet that got around; EBCDIC was the alphabet that stayed home and grew very, very rich. If you've got a favorite encoding horror story from a real mainframe, I want to hear it — mine is the @ sign, and I'm still mad. In the meantime, the studio is open, the pricing page is honest, and somewhere out there, a mainframe is spelling your name with holes in the alphabet.

ASCII vs EBCDIC: the format war you never knew happened — ascii.im Blog