C/C++ : EBCDIC to Ascii Converter

ASCII is the American Standard Code for Information Interchange, also known as ANSI X3.4. There are many variants of this standard, typically to allow different code pages for language encoding, but they all basically follow the same format. ASCII is quite elegant in the way it represents characters, and it is very easy to write code to manipulate upper/lowercase and check for valid data ranges.
ASCII is essentially a 7-bit code which allows the 8th most significant bit (MSB) to be used for error checking, however most modern computer systems tend to use ASCII values of 128 and above for extended character sets.

EBCDIC (Extended Binary Coded Decimal Interchange Code) is a character encoding set used by IBM mainframes. Unlike virtually every computer system in the world which uses a variant of ASCII, IBM mainframes and midrange systems such as the AS/400 tend to use a wholly incompatible character set primarily designed for ease of use on punched cards. EBCDIC uses the full 8 bits available to it, so parity checking cannot be used on an 8 bit system. Also, EBCDIC has a wider range of control characters than ASCII.

I try to create C/C++ code EBCDIC to Ascii Converter. Save this code with name main.c

We can compile this code EBCDIC to Ascii Converter with command :

gcc main.c -o ebc2ascii

This is output program for EBCDIC to Ascii Converter :

You can read about how to convert Ascii to EBCDIC in here.

Source :


2 thoughts on “C/C++ : EBCDIC to Ascii Converter

  1. Thanks for posting this! Exactly what I was looking for.. easy to understand and fully working conversion of EBCDIC to ASCII, good job man!

Leave a Reply

Your email address will not be published. Required fields are marked *


This site uses Akismet to reduce spam. Learn how your comment data is processed.