JA Technology Solutions
Packed Decimal / COMP-3 Converter
Decode and encode packed decimal (COMP-3), zoned decimal, and trailing overpunch for IBM i and mainframe systems.
Packed Decimal / COMP-3 Converter
Convert between packed decimal (COMP-3), zoned decimal (DISPLAY), trailing overpunch, and readable numeric values. Used on IBM i (RPG packed/zoned fields) and mainframes (COBOL COMP-3/DISPLAY). Visual nibble breakdown, configurable decimal places, RPG and COBOL definition display. Supports positive, negative, and unsigned values.
Learn more ↓
Loading interactive explorer...
What Is Packed Decimal (COMP-3)?
Packed decimal is a binary-coded decimal format that stores two digits per byte, with the last nibble (half-byte) reserved for the sign (C for positive, D for negative, F for unsigned). The value +12345 is stored as three bytes: 12 34 5C. On IBM mainframes running COBOL, this format is called COMP-3; on IBM i (AS/400) running RPG, it is simply “packed.” Zoned decimal (DISPLAY in COBOL, zoned in RPG) stores one digit per byte with the sign embedded in the zone nibble of the last byte using an overpunch convention inherited from punch card encoding.
Packed Decimal in IBM i and COBOL
Packed decimal is the default numeric storage format on IBM i and mainframe systems because it is compact and supports exact decimal arithmetic without floating-point rounding errors — essential for financial calculations. A 9-digit packed field uses only 5 bytes versus 9 bytes for zoned decimal. When you extract data from these systems as raw binary files, numeric fields appear as unintelligible hex bytes unless you know the field layout (position, length, decimal places, and format). Misinterpreting a packed field as text — or applying EBCDIC-to-ASCII conversion to it — destroys the numeric data.
Legacy Data Extraction and Migration
This tool decodes individual packed and zoned values for inspection and debugging. Production data extraction requires processing entire files with mixed text and numeric fields, applying the correct conversion to each field based on the record layout. I build data extraction and migration pipelines that parse fixed-width records from IBM i and mainframe systems, decode packed decimal, zoned decimal, and binary fields, and deliver clean data to modern databases and applications. Learn about IBM i services, explore migration capabilities and ETL development, or get in touch.
All tools run entirely in your browser. Your data never leaves your machine. Need help? Ask James.