MainframeMaster

EBCDIC hex converter

This converter translates EBCDIC hex into text and text into EBCDIC hex. It supports seven IBM code pages: 037, 273, 285, 500, 1047, 1140, and 1148. Each page uses the byte-to-character table from the ICU mapping file with the same number (ibm-37, ibm-273, and so on).

Using the converter

  1. Select the code page that matches the system that created the data. Code page 037 is the common US default. Code page 1047 is used by z/OS UNIX System Services and by Java on z/OS.
  2. For hex to text, enter each byte as two hex digits. Spaces, commas, colons, and 0x prefixes are ignored.
  3. For text to hex, select NL (byte 15) or LF (byte 25) for line breaks. Mainframe text files usually use NL.

The converter runs in your browser. Input is not sent to a server.

EBCDIC hex converter

Text

Hex

The text output shows bytes 15, 25, and 0D as line breaks. Converting it back to hex uses the NL or LF setting, so bytes 25 and 0D can return as 15.

OffsetEBCDICUnicodeCharacter
0000C8U+0048H
0001C5U+0045E
0002D3U+004CL
0003D3U+004CL
0004D6U+004FO

Need this at work?

Free account saves tutorial progress. The jobs board lists openings that ask for JCL.

Mainframe jobs on the board

How letters are encoded

Space is 40 on all seven pages. Digits 0 through 9 are F0 through F9. Uppercase letters fall into three blocks: A through I are C1 through C9, J through R are D1 through D9, and S through Z are E2 through E9. Lowercase letters use the same three-block layout at 81 through 89, 91 through 99, and A2 through A9. Within each case, byte values still increase alphabetically, but the values have gaps. Across cases, every lowercase letter sorts before every uppercase letter.

The same word uses different bytes in each encoding:

text
1
2
C8 C5 D3 D3 D6 HELLO on code page 037 48 45 4C 4C 4F HELLO in ASCII

Where the code pages differ

Letters, digits, and the space character use the same bytes on all seven pages. Brackets, the vertical bar, and several national characters do not. To check which page a dump uses, decode the brackets, the pound sign, the dollar sign, or an umlaut and compare the result with the table below.

  • On 037 (US), [ is BA and ] is BB. The caret is B0, the not sign is 5F, the dollar sign is 5B, and the pound sign is B1.
  • On 500 (international Latin-1), [ is 4A and ] is 5A. Byte 4F is an exclamation mark here, where 037 uses the vertical bar. The vertical bar is BB, the caret is 5F, and the not sign is BA.
  • On 1047 (z/OS UNIX and Java), [ is AD and ] is BD. The caret is 5F and the not sign is B0. Letters and digits match 037.
  • Code pages 1140 and 1148 differ from 037 and 500 at one byte. Byte 9F is the euro sign (U+20AC) on 1140 and 1148. On 037 and 500, it is the currency sign (U+00A4).
  • On 285 (United Kingdom), the pound sign is 5B, where 037 uses the dollar sign. The dollar sign moves to 4A, where 037 has the cent sign.
  • On 273 (Germany and Austria), [ is 63 and ] is FC. Ä is 4A, ä is C0, and ß is A1. On 037, those bytes hold the cent sign, {, and ~.

Line breaks

Byte 0A is not a line break on these code pages. It is a control character. New line is byte 15, which maps to Unicode U+0085 (NEL). Line feed is byte 25, which maps to U+000A. Carriage return is byte 0D. When a file moves between an EBCDIC system and an ASCII system without a code-page conversion, the line breaks are often the first thing that looks wrong.

The text panel shows bytes 15, 25, and 0D as line breaks. The byte table lists the Unicode value for each byte. Copy the hex output when you need the exact bytes.

Packed decimal fields

COMP-3 fields are stored as packed decimal. Each byte holds two digits. The last nibble holds the sign: C for positive, D for negative, and F for unsigned. This converter reads every byte as a character, so a packed field appears as unrelated symbols. Use the COMP-3 converter for those fields. Until a record-level tool is available, separate the character fields from the packed fields by their offsets in the copybook, and convert each part on its own.

Explain it like I'm 5

Each letter on a mainframe has a number, and that number differs from the number a PC uses. The mainframe stores A as C1. A PC stores A as 41. The converter reads the mainframe number and returns the letter, and it works in reverse. Select the code page that matches the system that wrote the file, because a few symbols have different numbers on different pages.

FAQ

Related Pages

More detail

The COBOL overview of EBCDIC is on EBCDIC in COBOL. Sort order and code pages in DFSORT are covered on EBCDIC nuances. Other converters and calculators are listed on /tools.