ASCII to EBCDIC Converter
Convert ASCII to EBCDIC and EBCDIC to ASCII online. Uses IBM CP037 mapping with hex, decimal, and character output views. Free bidirectional converter.
| # | Input Char | Input Hex | Input Dec | Output Hex | Output Dec | Output Char |
|---|
About
Mainframe systems from IBM use EBCDIC (Extended Binary Coded Decimal Interchange Code), a character encoding incompatible with the ASCII standard used by virtually all modern systems. Transferring data between these environments without proper conversion corrupts field values, breaks fixed-width record layouts, and produces unreadable output. A single mis-mapped byte in a COBOL copybook can cascade into millions of corrupted records during batch processing. This tool implements the full IBM Code Page 037 (CP037) mapping - the most common EBCDIC variant used in US/Canada/Europe - providing exact bidirectional translation across all 256 byte values.
The converter handles printable characters, control codes, and extended values. Note: EBCDIC has no single universal standard. CP037 differs from CP500 (International) and CP1047 (Open Systems) in approximately 6 - 8 code points, primarily around brackets and currency symbols. This tool uses CP037 exclusively. If your mainframe environment uses a different code page, verify bracket and special character mappings before production use.
Formulas
ASCII-to-EBCDIC conversion is not a mathematical function. It is a direct byte-level lookup against a fixed mapping table. For a given input byte b in the source encoding, the output byte is:
Where MAPCP037 is a 256-entry bijective lookup table defined by IBM Code Page 037. Every value from 0x00 to 0xFF has exactly one corresponding value in the target encoding. The reverse conversion uses the inverse table:
Where b โ [0, 255] - the full byte range. For text input, each character's code point is extracted via charCodeAt(0), mapped through the table, and the result is presented in hexadecimal (toString(16)), decimal, or character form. Characters with code points above 255 fall outside the mapping domain and are flagged as unmappable.
Reference Data
| ASCII Char | ASCII Hex | ASCII Dec | EBCDIC Hex | EBCDIC Dec | Description |
|---|---|---|---|---|---|
| SP | 20 | 32 | 40 | 64 | Space |
| 0 | 30 | 48 | F0 | 240 | Digit Zero |
| 1 | 31 | 49 | F1 | 241 | Digit One |
| 9 | 39 | 57 | F9 | 249 | Digit Nine |
| A | 41 | 65 | C1 | 193 | Uppercase A |
| I | 49 | 73 | C9 | 201 | Uppercase I |
| J | 4A | 74 | D1 | 209 | Uppercase J |
| R | 52 | 82 | D9 | 217 | Uppercase R |
| S | 53 | 83 | E2 | 226 | Uppercase S |
| Z | 5A | 90 | E9 | 233 | Uppercase Z |
| a | 61 | 97 | 81 | 129 | Lowercase a |
| i | 69 | 105 | 89 | 137 | Lowercase i |
| j | 6A | 106 | 91 | 145 | Lowercase j |
| r | 72 | 114 | 99 | 153 | Lowercase r |
| s | 73 | 115 | A2 | 162 | Lowercase s |
| z | 7A | 122 | A9 | 169 | Lowercase z |
| . | 2E | 46 | 4B | 75 | Period |
| , | 2C | 44 | 6B | 107 | Comma |
| + | 2B | 43 | 4E | 78 | Plus Sign |
| - | 2D | 45 | 60 | 96 | Hyphen / Minus |
| / | 2F | 47 | 61 | 97 | Forward Slash |
| = | 3D | 61 | 7E | 126 | Equals Sign |
| @ | 40 | 64 | 7C | 124 | At Sign |
| # | 23 | 35 | 7B | 123 | Hash / Number Sign |
| $ | 24 | 36 | 5B | 91 | Dollar Sign |
| * | 2A | 42 | 5C | 92 | Asterisk |
| & | 26 | 38 | 50 | 80 | Ampersand |
| ! | 21 | 33 | 5A | 90 | Exclamation Mark |
| ? | 3F | 63 | 6F | 111 | Question Mark |
| NUL | 00 | 0 | 00 | 0 | Null Character |
| LF | 0A | 10 | 25 | 37 | Line Feed |
| CR | 0D | 13 | 0D | 13 | Carriage Return |