User Rating 0.0 โ˜…โ˜…โ˜…โ˜…โ˜…
Total Usage 0 times
0 characters
Is this tool helpful?

Your feedback helps us improve.

โ˜… โ˜… โ˜… โ˜… โ˜…

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.

ascii ebcdic converter code page cp037 ibm mainframe character encoding hex converter

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:

output = MAPCP037[b]

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:

input = MAPโˆ’1CP037[output]

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 CharASCII HexASCII DecEBCDIC HexEBCDIC DecDescription
SP20324064Space
03048F0240Digit Zero
13149F1241Digit One
93957F9249Digit Nine
A4165C1193Uppercase A
I4973C9201Uppercase I
J4A74D1209Uppercase J
R5282D9217Uppercase R
S5383E2226Uppercase S
Z5A90E9233Uppercase Z
a619781129Lowercase a
i6910589137Lowercase i
j6A10691145Lowercase j
r7211499153Lowercase r
s73115A2162Lowercase s
z7A122A9169Lowercase z
.2E464B75Period
,2C446B107Comma
+2B434E78Plus Sign
-2D456096Hyphen / Minus
/2F476197Forward Slash
=3D617E126Equals Sign
@40647C124At Sign
#23357B123Hash / Number Sign
$24365B91Dollar Sign
*2A425C92Asterisk
&26385080Ampersand
!21335A90Exclamation Mark
?3F636F111Question Mark
NUL000000Null Character
LF0A102537Line Feed
CR0D130D13Carriage Return

Frequently Asked Questions

CP037 and CP500 are both EBCDIC variants but differ in approximately 6-8 code point assignments. The primary differences involve bracket characters, exclamation marks, and certain currency symbols. CP037 is the standard for US/Canada systems while CP500 is designated as the "International" code page. For example, the left square bracket maps to 0xBA in CP037 but 0x4A in CP500. Always verify which code page your mainframe environment uses before performing bulk conversions.
In ASCII, uppercase letters A-Z occupy a continuous range from 0x41 to 0x5A (decimal 65-90). EBCDIC splits the alphabet into three groups: A-I (0xC1-0xC9), J-R (0xD1-0xD9), and S-Z (0xE2-0xE9). This reflects EBCDIC's origin in punch card encoding (BCD), where character zones were determined by the punch row combinations. This non-contiguity means simple range checks like "if charCode >= 65 && charCode <= 90" do not work in EBCDIC - a common source of bugs when porting C programs to mainframes.
ASCII line feed (LF, 0x0A) maps to EBCDIC 0x25 under CP037. However, EBCDIC systems traditionally use NL (New Line, 0x15) as their line terminator, which maps to ASCII 0x15 (NAK control character). This converter performs strict CP037 byte mapping. If you are converting files that will be used on a mainframe, you may need to additionally convert LF (0x25) to NL (0x15) depending on your system's expectations. This is a separate post-processing step not covered by the raw code page translation.
This tool converts any byte value in the range 0x00-0xFF. When using hex input mode, you can enter raw hex bytes including non-printable control characters and high-byte values. The full 256-entry CP037 table is implemented, covering all possible byte values. For binary file conversion, enter the file content as hexadecimal pairs separated by spaces.
Characters above code point 255 (such as emoji, CJK characters, or extended Latin) have no mapping in either ASCII or EBCDIC, which are both single-byte encodings limited to 256 values. The converter flags these as unmappable and substitutes 0x3F (question mark) in the output - the standard IBM convention for unmappable characters. A warning count is displayed when this occurs.
Yes. When you receive a hex dump from a z/OS system or a raw EBCDIC file transferred in binary mode (not text mode) via FTP, the bytes are EBCDIC-encoded. Pasting the hex values into this converter in EBCDIC-to-ASCII mode will produce the readable ASCII text. Ensure the file was transferred in binary mode - text-mode FTP transfers usually perform the conversion automatically, and double-converting will corrupt the data.