0200 leaves for the wire as 30 32 30 30 on an ASCII link, as 02 00 packed BCD, and as F0 F2 F0 F0 EBCDIC. Same four characters, 4, 2 and 4 bytes โ and every field boundary in the message moves with that count. Below: the three side by side, the packed BCD rules, and the full EBCDIC (CP500) to ASCII table.
Three values that appear in almost every authorization message, each written out the three ways it can travel. Watch the byte counts, not just the byte values.
MTI 0200 โ 4 digits:
| Representation | Bytes on the wire | Length |
|---|---|---|
| ASCII | 30 32 30 30 | 4 bytes |
| Packed BCD | 02 00 | 2 bytes |
| EBCDIC (CP500) | F0 F2 F0 F0 | 4 bytes |
DE4 amount 000000005000 โ n 12, $50.00 in minor units:
| Representation | Bytes on the wire | Length |
|---|---|---|
| ASCII | 30 30 30 30 30 30 30 30 35 30 30 30 | 12 bytes |
| Packed BCD | 00 00 00 00 50 00 | 6 bytes |
| EBCDIC (CP500) | F0 F0 F0 F0 F0 F0 F0 F0 F5 F0 F0 F0 | 12 bytes |
DE2 PAN 5413330089010001 โ 16 digits:
| Representation | Bytes on the wire | Length |
|---|---|---|
| ASCII | 35 34 31 33 33 33 30 30 38 39 30 31 30 30 30 31 | 16 bytes |
| Packed BCD | 54 13 33 00 89 01 00 01 | 8 bytes |
| EBCDIC (CP500) | F5 F4 F1 F3 F3 F3 F0 F0 F8 F9 F0 F1 F0 F0 F0 F1 | 16 bytes |
The length difference is the whole story. A parser that expects ASCII and receives BCD consumes twice as many characters as exist; one that expects BCD and receives ASCII stops halfway through the field. Either way every boundary after the first mismatched field is wrong โ which is why encoding sits at step two of the parse-failure check order, right after framing. To see any of these byte strings decoded live, paste them into the hex viewer: it renders the same bytes as ASCII and EBCDIC in parallel columns.
One thing the three tables quietly demonstrate: a field format like n 12 tells you the field holds twelve digits โ it does not tell you whether those digits occupy 12 bytes or 6. Format notation and encoding are two independent agreements, and the notation guide covers the first one only. The second is settled per link, in the interface specification.
Packed BCD (binary-coded decimal) stores one decimal digit in each 4-bit nibble, so a byte carries two digits โ high nibble first. 0200 becomes 02 00; the hex dump of a BCD field reads exactly like the number itself, which is both its charm and the easiest way to recognise it.
That halving is the reason BCD exists on payment links at all: an n 12 amount drops from 12 bytes to 6, a 16-digit PAN from 16 to 8. Across millions of messages and batch records the savings were worth caring about when these interfaces were designed, and the convention outlived the constraint. The hex / decimal / BCD converter does the packing and unpacking interactively, including the byte counts.
Two properties follow from the nibble layout:
123 โ 01 23); others fill with a trailing F (123 โ 12 3F). Both are common, they are not interchangeable, and nothing in the bytes announces which one is in force: that is set by your endpoint's specification.EBCDIC is a family of code pages, not one encoding. CP037, CP500, CP1047 and dozens of national variants agree on digits, letters and most punctuation but disagree at a handful of positions โ square brackets, the exclamation mark, the vertical bar and a few other symbols sit at different code points depending on the page. The tables below are CP500 (International), the same code page the hex viewer decodes with. If your counterparty declares a different page, the rows marked "varies" are exactly the ones to re-check against their specification.
The rows you will use most. An EBCDIC digit is F plus the digit in the low nibble โ which is why a numeric field dumped from an EBCDIC file is a wall of F0โF9, and why stripping the high nibble of each byte recovers the packed-BCD form of the same number.
| EBCDIC (CP500) | Character | ASCII |
|---|---|---|
F0 | 0 | 30 |
F1 | 1 | 31 |
F2 | 2 | 32 |
F3 | 3 | 33 |
F4 | 4 | 34 |
F5 | 5 | 35 |
F6 | 6 | 36 |
F7 | 7 | 37 |
F8 | 8 | 38 |
F9 | 9 | 39 |
Unlike ASCII, the EBCDIC alphabet is not contiguous: it runs in three blocks, C1โC9 (AโI), D1โD9 (JโR) and E2โE9 (SโZ), with unrelated code points in the gaps. Any code that range-checks "between A and Z" byte-wise breaks on EBCDIC data.
| EBCDIC (CP500) | Character | ASCII |
|---|---|---|
C1 | A | 41 |
C2 | B | 42 |
C3 | C | 43 |
C4 | D | 44 |
C5 | E | 45 |
C6 | F | 46 |
C7 | G | 47 |
C8 | H | 48 |
C9 | I | 49 |
D1 | J | 4A |
D2 | K | 4B |
D3 | L | 4C |
D4 | M | 4D |
D5 | N | 4E |
D6 | O | 4F |
D7 | P | 50 |
D8 | Q | 51 |
D9 | R | 52 |
E2 | S | 53 |
E3 | T | 54 |
E4 | U | 55 |
E5 | V | 56 |
E6 | W | 57 |
E7 | X | 58 |
E8 | Y | 59 |
E9 | Z | 5A |
The same three-block pattern, one bit lower: 81โ89, 91โ99, A2โA9. Note that every lowercase letter has the high bit set โ bytes that would be outside printable ASCII entirely.
| EBCDIC (CP500) | Character | ASCII |
|---|---|---|
81 | a | 61 |
82 | b | 62 |
83 | c | 63 |
84 | d | 64 |
85 | e | 65 |
86 | f | 66 |
87 | g | 67 |
88 | h | 68 |
89 | i | 69 |
91 | j | 6A |
92 | k | 6B |
93 | l | 6C |
94 | m | 6D |
95 | n | 6E |
96 | o | 6F |
97 | p | 70 |
98 | q | 71 |
99 | r | 72 |
A2 | s | 73 |
A3 | t | 74 |
A4 | u | 75 |
A5 | v | 76 |
A6 | w | 77 |
A7 | x | 78 |
A8 | y | 79 |
A9 | z | 7A |
Sorted by EBCDIC code point. The "varies" rows are the classic cross-code-page traps: those characters sit at different positions in CP037 and CP1047, so a file decoded with the wrong page comes out with brackets and bars swapped for other symbols while everything else looks fine.
| EBCDIC (CP500) | Character | ASCII | Notes |
|---|---|---|---|
40 | space | 20 | EBCDIC padding runs are 40, not 20 |
4A | [ | 5B | varies by code page |
4B | . | 2E | |
4C | < | 3C | |
4D | ( | 28 | |
4E | + | 2B | |
4F | ! | 21 | varies by code page |
50 | & | 26 | |
5A | ] | 5D | varies by code page |
5B | $ | 24 | |
5C | * | 2A | |
5D | ) | 29 | |
5E | ; | 3B | |
5F | ^ | 5E | varies by code page |
60 | - | 2D | |
61 | / | 2F | |
6B | , | 2C | |
6C | % | 25 | |
6D | _ | 5F | |
6E | > | 3E | |
6F | ? | 3F | |
79 | ` | 60 | |
7A | : | 3A | |
7B | # | 23 | |
7C | @ | 40 | 40 is @ in ASCII but space in EBCDIC |
7D | ' | 27 | |
7E | = | 3D | |
7F | " | 22 | |
A1 | ~ | 7E | |
BB | | | 7C | varies by code page |
C0 | { | 7B | |
D0 | } | 7D | |
E0 | \ | 5C |
Control characters and the unassigned positions are deliberately not listed โ they never appear in message text on purpose. For any byte outside these tables, paste the hex into the hex viewer and read it off the dump: it decodes all 256 positions, byte by byte.
Start at byte zero. The MTI is the first field of every message, its value is one of a short list, and each encoding gives it away differently:
| If the dump starts withโฆ | It reads as | Verdict |
|---|---|---|
30 31 / 30 32 / 30 38โฆ | 01โ08xx as ASCII digits | ASCII |
01 00 / 02 00 / 08 00โฆ | the MTI literally, two bytes | Packed BCD |
F0 F1 / F0 F2 / F0 F8โฆ | 01โ08xx as EBCDIC digits | EBCDIC |
Past the first bytes, the statistics of the dump usually settle it on sight:
F0โF9 is EBCDIC, almost without exception. In ASCII, everything above 7E is unprintable, so no text produces those bytes; in EBCDIC they are simply the digits, and payment data is mostly digits. Runs of 40 between them are EBCDIC spaces.30โ39 with 20 in between is ASCII โ digits and spaces again, one encoding over. ASCII text also never sets the high bit, so a dump full of bytes above 80 is either EBCDIC or not text at all.54 13 33 00 89 01 00 01 renders as T.3..... in ASCII, but read as hex it is simply the PAN.When the statistics are ambiguous โ short dump, mixed per-field encodings โ decode it all three ways and keep the reading that yields a plausible MTI and a bitmap whose bits match the fields you can see. Three attempts in the hex viewer (ASCII and EBCDIC in one paste) plus the BCD converter take about two minutes, which is reliably faster than locating the encoding clause in an interface document. That try-all-three step is exactly where the parse-failure check order puts encoding: after framing, before anything field-level.
Batch clearing leans EBCDIC. Mastercard IPM (T112) clearing files are the canonical case: mainframe-era platforms, mainframe-native character set, unchanged since. If a "corrupted" file turns readable in the EBCDIC column of a hex dump, that is what you are holding โ and the IPM file parser decodes those records field by field.
Online authorization links are most often ASCII, with packed BCD common on links that care about message size โ frequently per field, numeric fields packed and text fields not. Which combination your link uses is a property of that link's interface specification, not of the card network in general, so take it from the spec โ or determine it empirically as above, which is usually faster.
The annotated sample messages are written in the friendliest form of all โ plain ASCII text โ precisely so you can paste them straight into the parser and watch a full decode without fighting byte-level encoding first. That page's encoding notes cover how the same samples change shape on a packed link.
๐ Holding a real dump right now? Paste it into the hex viewer to see ASCII and EBCDIC side by side, then hand the winner to the parser for the field-by-field breakdown.