convert | encode | mainframe

> ebcdic | ibm | legacy <

// EBCDIC - Extended Binary Coded Decimal Interchange Code

0 chars
0 chars
[MAINFRAME]

IBM Mainframe

Standard character encoding for IBM mainframe systems.

[CODE PAGES]

Multiple Variants

Support for different EBCDIC code pages and locales.

[LEGACY]

Legacy Support

Essential for working with legacy mainframe data.

>> technical info

How EBCDIC Works:

EBCDIC (Extended Binary Coded Decimal Interchange Code) is an 8-bit character encoding developed by IBM. Unlike ASCII which groups related characters together, EBCDIC spreads them across the code space due to its evolution from punch card codes. Different EBCDIC code pages support various languages and regions, with EBCDIC 037 being the most common for US/Canada.

EBCDIC vs ASCII Examples:

Character mappings (EBCDIC 037):

Char | ASCII | EBCDIC
-----|-------|--------
Space| 0x20  | 0x40
  A  | 0x41  | 0xC1
  B  | 0x42  | 0xC2
  0  | 0x30  | 0xF0
  1  | 0x31  | 0xF1
  a  | 0x61  | 0x81
  b  | 0x62  | 0x82

"ABC" in ASCII: 41 42 43
"ABC" in EBCDIC: C1 C2 C3

"123" in ASCII: 31 32 33
"123" in EBCDIC: F1 F2 F3

Why Use EBCDIC:

  • Required for IBM mainframes
  • Legacy system compatibility
  • Data migration projects
  • COBOL and mainframe development
  • Historical data preservation

>> frequently asked questions

What is EBCDIC?

EBCDIC (Extended Binary Coded Decimal Interchange Code) is an 8-bit character encoding developed by IBM in 1963. It's primarily used on IBM mainframe and midrange computer systems. Unlike ASCII, EBCDIC's character arrangement reflects its punch card heritage.

Why is EBCDIC different from ASCII?

EBCDIC evolved from punch card codes where holes in specific positions represented characters. This led to a non-contiguous arrangement - letters aren't sequential, and there are gaps between letter groups. ASCII was designed from scratch for efficiency, making it more logical for modern computing.

What are EBCDIC code pages?

EBCDIC has multiple variants called code pages for different languages and regions. Common ones include: EBCDIC 037 (US/Canada), EBCDIC 500 (International), EBCDIC 875 (Greek), and EBCDIC 1047 (Open Systems). Each maps characters differently to support local requirements.

Where is EBCDIC still used?

EBCDIC is still widely used in IBM mainframe environments (z/OS, z/VM, z/VSE), banking and financial systems, government legacy systems, and COBOL applications. Many organizations maintain EBCDIC systems for critical business processes that have run reliably for decades.

How do I convert EBCDIC to ASCII online?

Choose the TO ASCII tab, pick the correct EBCDIC code page (CP037 is the default for US English mainframes — ask your z/OS admin if you aren't sure), and paste the EBCDIC data as a hex string (e.g., C1 C2 C3 or C1C2C3). Click the convert button — the tool maps each EBCDIC byte to its ASCII equivalent and shows readable text (ABC in this case). Spaces, tabs, and 0x prefixes are stripped automatically.

How do I convert ASCII to EBCDIC online?

Choose the TO EBCDIC tab, select your target code page, and paste or type ASCII text into the input field. The tool outputs the corresponding EBCDIC bytes as hex. For example, Hello in ASCII becomes C8 85 93 93 96 in EBCDIC 037. Enable Show Hex Output to see the full mapping, or disable it for the textual preview.

What is the EBCDIC to ASCII mapping for common characters?

The full EBCDIC 037 ↔ ASCII mapping for printable characters:

CharacterASCII (hex)EBCDIC (hex)
Space0x200x40
0 – 90x30 – 0x390xF0 – 0xF9
A – I0x41 – 0x490xC1 – 0xC9
J – R0x4A – 0x520xD1 – 0xD9
S – Z0x53 – 0x5A0xE2 – 0xE9
a – i0x61 – 0x690x81 – 0x89
j – r0x6A – 0x720x91 – 0x99
s – z0x73 – 0x7A0xA2 – 0xA9
&0x260x50
.0x2E0x4B
<0x3C0x4C
(0x280x4D
+0x2B0x4E
!0x210x5A
$0x240x5B
*0x2A0x5C
)0x290x5D
,0x2C0x6B
/0x2F0x61
=0x3D0x7E
@0x400x7C

Notice the non-contiguous letter ranges — that is why a straight byte-comparison between EBCDIC and ASCII files fails.

Why are the EBCDIC letters A-Z not in a single continuous block?

EBCDIC inherited its layout from IBM punch cards, where the letters A–Z were printed in three groups (A–I, J–R, S–Z) with gaps at the end of each group. When IBM designed EBCDIC in 1963, they kept the same bit patterns so existing punch-card hardware and software would work unchanged. This is why I (0xC9) is immediately followed by J (0xD1) with an 8-byte gap — a constant source of bugs when programmers assume letters are sequential like they are in ASCII.

What are the most common EBCDIC code pages?

  • CP037 (EBCDIC 037) — US, Canada, Netherlands, Portugal, Brazil; the most common mainframe code page
  • CP500 — International set, Belgium, Switzerland
  • CP1047 — Open Systems (Latin-1); preferred for C/C++ on z/OS because the square brackets match most C source code
  • CP273 — Germany, Austria
  • CP277 — Denmark, Norway
  • CP278 — Finland, Sweden
  • CP280 — Italy
  • CP284 — Spain, Latin America
  • CP297 — France
  • CP500 — Multilingual/International
  • CP870 — Eastern Europe (Latin-2)
  • CP875 — Greek
  • CP1140 — US + Euro currency symbol
If you are not sure which page was used, check DD statements in your JCL or ask the mainframe administrator — mismatching the code page will silently corrupt currency symbols, square brackets, and accented characters.

How do I convert EBCDIC files in code?

Python"text".encode('cp037') to encode, bytes.decode('cp037') to decode; Python natively supports cp037, cp500, cp1047, and others.
Javanew String(bytes, "Cp037") and str.getBytes("Cp037").
JavaScript (Node.js) — requires the iconv-lite package: iconv.encode(str, 'cp037').
IBM z/OS (USS)iconv -f IBM-037 -t IBM-1047 file.in > file.out.
Shell (Linux/macOS)iconv -f IBM037 -t UTF-8 file.in.
Always double-check the code page; a file labeled simply "EBCDIC" could be any of dozens of variants.

What happens to the newline character when moving between EBCDIC and ASCII?

ASCII uses line feed (LF, 0x0A) or carriage return + line feed (CRLF, 0x0D 0x0A). EBCDIC uses NL (New Line, 0x15) on most mainframes, though some environments use 0x25 (LF) depending on the code page. Many file transfers (FTP in ASCII mode, NDM, Connect:Direct) automatically translate line endings — but if you transfer a mainframe dataset in binary mode, you must convert the newlines yourself in addition to translating the characters.

Is EBCDIC case-insensitive?

No — EBCDIC has distinct code points for uppercase (0xC1–0xE9 with gaps) and lowercase (0x81–0xA9 with gaps), just like ASCII. It is not a case-insensitive encoding. What is different is that there is no simple bit flip to switch case: A is 0xC1, a is 0x81 — a difference of 0x40. ASCII uses the 0x20 bit, so most C code that does c | 0x20 to force lowercase breaks on EBCDIC.

Is EBCDIC still worth learning today?

If you work anywhere near financial services, insurance, airline reservations, government systems, healthcare payers, or legacy COBOL/PL/I codebases — yes. Mainframe systems still process a huge share of the world's transactions (IBM claims Z systems handle ~70% of global enterprise transactions by value), and all that data lives in EBCDIC. Understanding EBCDIC ↔ ASCII translation, the common code pages, and the gotchas around newlines and collating sequences is essential for anyone doing mainframe integration, data migration, or batch-file ETL.

Other Languages