ForHosting KIT · Developer Utilities

EBCDIC encoder

Turn text into IBM mainframe bytes and back: Hello becomes c8 85 93 93 96 on code page 037, and a pasted hex dump from a COBOL file or trace comes back as readable text. Free in your browser.

  • Free
  • Runs in your browser
  • No sign-up
  • Your data stays on your device
Use it from WebAPIEmailTelegramApp soon
If you enter
Text
Hello
Calculation mode
To ebcdic
You get
Result
c8 85 93 93 96
Code page
037
Input
Hello
Ebcdic hex
c8 85 93 93 96

Characters outside code page 037—emoji, CJK ideographs, and other Unicode outside the Latin-1 set that CP037 defines—are listed in an unmapped report with index and code point so you can fix the source instead of guessing. The algorithm is a pure table-driven round-trip: no network, no random seeds, no wall-clock dependence.

Why EBCDIC still turns up

EBCDIC is the character set IBM designed for punched cards and the System/360, and code page 037, the version for the United States and Canada, is still found in COBOL record layouts, VSAM dumps and messages passed between mainframe systems. It stores the same letters as ASCII but on different byte values: a capital A is C1 in hexadecimal, the digit zero is F0 and a space is 40, while ASCII uses 65, 48 and 32 in decimal. That is why a mainframe file opened as UTF-8 or ISO-8859-1 shows garbled characters and field lengths that no longer add up. Converting through the right table is the only reliable fix.

How the conversion works and what to watch for

Every character up to 255, the Latin-1 range, has exactly one EBCDIC byte on code page 037, shown as two lowercase hex digits, so Hello becomes c8 85 93 93 96. Going the other way, each pair of hex digits becomes one byte and then one character. Emoji, Chinese characters and anything else beyond Latin-1 have no byte on this page, so they are left out and listed with their position and code point instead of being guessed. Keep in mind that this is code page 037 only: it does not read packed decimal numbers, code page 500 or UTF-8 byte dumps, and using the wrong page gives wrong letters.

How ASCII and EBCDIC code page 037 relate, and why unmapped characters matter

ASCII stores Latin letters in a familiar contiguous block: capital A is sixty-five decimal, digits run from forty-eight upward, and space is thirty-two. EBCDIC, designed for IBM punched cards and System/360, rearranges those glyphs into a different byte layout. On code page 037, capital A becomes hexadecimal C1, digit zero becomes F0, and space becomes 40.

That rearrangement is not optional trivia—if you treat an EBCDIC file as UTF-8 or ISO-8859-1, you get mojibake and broken field lengths. This tool implements the bidirectional mapping used by IBM CCSID 037: every byte zero through two hundred fifty-five maps to a Latin-1 Unicode scalar, and every Latin-1 scalar maps back to exactly one EBCDIC byte. Encoding walks each Unicode code point in your string; when the code point is between zero and two hundred fifty-five inclusive, the corresponding EBCDIC byte is appended as two hex digits.

Decoding accepts whitespace-separated hex pairs or a continuous even-length hex string, converts each pair to a byte, and expands that byte through the reverse table into text.

Teaching and support triage

Students and L2 engineers decode hex dumps from CICS traces to readable text and compare hand-encoded worksheets to the deterministic table.

What is IBM EBCDIC code page 037?

Code page 037 (CCSID 037) is the classic US/Canada EBCDIC single-byte set used on IBM mainframes. It maps all 256 bytes to Latin-1 Unicode scalars and rearranges letters and digits relative to ASCII.

Does it support accented Latin letters?

Yes for characters in the Latin-1 range that CP037 defines (for example many Western European accents). Characters outside that set are reported as unmapped on encode.

Is the EBCDIC encoder free?

The browser tool is free and runs locally.

Why does an EBCDIC file look like gibberish when opened as ASCII?

Because EBCDIC puts letters on different byte values. On code page 037 a capital A is C1 and a space is 40, while ASCII uses 65 and 32, so reading the file the wrong way changes every character and breaks field lengths.

How do I decode an EBCDIC hex dump?

Choose the direction back to text and paste the hex bytes, either as pairs separated by spaces, commas, semicolons or pipes, or as one continuous string of even length. An odd length or an invalid pair is reported rather than padded.

Everything on this page is available programmatically. This section is for teams who want to wire it into their own systems; everyone else can just use the tool above.

POSThttps://api.kit.forhosting.com/enc/ebcdic

Prefer to automate it? One authenticated POST creates the task; the result comes back by webhook or a signed link. The same capability also runs here on the web, by email and from Telegram — and soon from our app too.

curl -X POST https://api.kit.forhosting.com/enc/ebcdic \
  -H "Authorization: Bearer $KIT_KEY" \
  -H "Content-Type: application/json" \
  -d '{"text":"Hello"}'
{
  "text": "Hello"
}
{
  "task_id": "tsk_a1b2c3d4e5f6a1b2c3d4e5f6",
  "type": "enc.ebcdic",
  "status": "queued",
  "_links": {
    "result": "/tasks/tsk_…/result"
  }
}

The API is asynchronous: the call returns a task_id immediately and the result arrives by webhook. Polling is capped at 1 req/s per task.

Per request$0.002

Published price — no tokens, no invented credits. A failed task is never charged.

max_chars100000
HTTPCodeMeaning
401unauthorizedMissing or invalid API key.
402insufficient_balanceYour balance doesn't cover the task price.
404unknown_typeThat task type doesn't exist.
429rate_limitedToo many requests. Use the webhook instead of polling.

An EBCDIC encoder translates everyday text into IBM mainframe code page 037, the classic US and Canada single-byte character set still found in COBOL copybooks, VSAM dumps, and MQ payloads. Paste plain text and choose to_ebcdic to receive space-separated hexadecimal EBCDIC bytes, or paste hex and choose to_ascii to recover readable characters.

How ASCII and EBCDIC code page 037 relate, and why unmapped characters matter

When the code point is higher, the character is omitted from the byte stream and recorded in unmapped with its string index and code_point so operators can strip or transliterate deliberately. Invalid hex tokens or an odd continuous length raise invalid_input rather than inventing padding. This landing targets searches for EBCDIC encoder, ASCII to EBCDIC converter, code page 037, and IBM mainframe character encoding—not packed decimal, not code page 500, and not UTF-8 byte dumps.

How to call the API and what the response contains

Send a JSON body with a required string field text (aliases input, value, and data) and an optional mode of to_ebcdic or to_ascii. The default mode is to_ebcdic: each mappable character becomes an EBCDIC CP037 byte written as lowercase hex, joined with spaces in result and ebcdic_hex. Mode to_ascii treats text as EBCDIC hex—pairs separated by spaces, commas, semicolons, pipes, or a continuous zero-to-nine A-to-F string whose length is even—and returns the recovered string in result and text. Input length is capped at one hundred thousand characters so a single request cannot exhaust Worker memory. On success both modes include mode, code_page set to the string 037, input, result, bytes as integer values zero to two hundred fifty-five, byte_count, char_count, mapped_count, unmapped_count, unmapped as an array of objects with index, char, and code_point, plus a short English message. Encode also exposes ebcdic_hex equal to result; decode normalizes ebcdic_hex to space-separated pairs even if you pasted continuous hex. Failed validation—missing text, non-string text, oversize input, an unknown mode, empty hex, odd-length continuous hex, or a token that is not exactly two hexadecimal digits—returns invalid_input and is never charged. Pricing is a flat $0.002 per successful request with unit item.

Practical tips, migration checks, and related tools

Round-trip checks are the fastest smoke test: encode Hello, confirm the first byte is C8 for H and that space would be 40, then decode the hex and confirm you recover the original string. Prefer this capability when the search intent is ASCII or Latin text versus IBM code page 037 hex; use a UTF-8 byte encoder when you need modern multi-byte sequences, and use Base64 tools when the goal is transport framing rather than character-set translation. When teaching, show the same letter as decimal ASCII, as CP037 hex, and as the wrong interpretation under ISO-8859-1 so students see why mainframe integrations still need an explicit EBCDIC step. Prefer to_ascii when you already copied hex from a dump, a CICS trace, or a hex editor and want the glyphs back. Deliberately include an emoji or a CJK character beside plain ASCII to assert that unmapped_count rises and that the EBCDIC stream contains only the mappable subset—migration scripts should fail closed when unmapped_count is non-zero if the target system cannot store those characters. Keep payloads under the published character limit; multi-megabyte binary datasets belong offline with iconv or dataset utilities. This tool is not a general EBCDIC family converter: code pages 500, 1047, and 1140 differ on currency and euro symbols, so do not assume the hex is portable across those CCSIDs. Failed tasks that return invalid_input do not consume prepaid balance, which keeps exploratory scripts cheap when learners paste incomplete hex groups.

Mainframe file and MQ payload fixtures

Build EBCDIC CP037 hex strings for integration tests that mock VSAM records, COBOL PIC X fields, or MQ messages without a z/OS box.

Migration and data-quality checks

Encode customer names and flags before load; reject batches when unmapped_count is greater than zero so emoji never reach EBCDIC-only columns.

How does the EBCDIC encoder report unmapped characters?

In to_ebcdic mode, any Unicode code point above 255 is skipped in the hex output and listed in unmapped with index, a display char, and code_point. mapped_count and unmapped_count summarize the run.

What format does to_ascii expect?

Hexadecimal EBCDIC bytes: space-separated pairs such as c8 85 or continuous even-length hex such as c885. Invalid or incomplete hex returns invalid_input.

Read the full KIT documentation →