ℹ️ About BCD Converter
Binary Coded Decimal (BCD) is a decimal-preserving binary representation: each base-10 digit is encoded as its own 4-bit nibble. For example, decimal 12 becomes 0001 0010 in BCD, not the pure binary value 1100.
This converter handles unsigned 8421-style BCD digit encoding, with decimal-to-BCD and BCD-to-decimal modes. It accepts grouped nibbles such as 0001 0010 0011, continuous bit strings such as 000100100011, or hexadecimal shorthand such as 0x123.
Common BCD use cases:
- Displaying decimal digits on seven-segment displays, counters, clocks, calculators, and measurement equipment.
- Debugging microcontroller registers, embedded protocols, or hardware interfaces that store decimal digits directly.
- Reading legacy mainframe, COBOL, and packed-decimal data formats where each digit occupies a nibble.
- Teaching the difference between digit encoding and true binary number conversion.
- Checking decimal identifiers that must keep leading zeroes visible during conversion.
Digit mapping:
- 0: 0000 | 1: 0001 | 2: 0010 | 3: 0011 | 4: 0100
- 5: 0101 | 6: 0110 | 7: 0111 | 8: 1000 | 9: 1001
- Invalid digit nibbles: 1010 through 1111 are rejected by this tool because ordinary unsigned BCD only represents decimal digits 0-9.
Examples: 123 encodes to 0001 0010 0011; 9075 encodes to 1001 0000 0111 0101; 0x420 decodes back to decimal 420.
Limitations: BCD is not a general binary base converter and this page does not perform BCD arithmetic. Signed packed decimal, zoned decimal, decimal floating-point, and dense packed decimal formats can add sign nibbles, zone bits, scale, or compression rules that need format-specific parsing. This converter intentionally limits input to 16 decimal digits or 16 BCD nibbles.
Privacy note: The interactive conversion runs locally in your browser as you type. If you use the public API endpoint instead, the submitted input is sent to the server for processing.
References: NIST CSRC glossary entry for Binary Coded Decimal and IBM documentation on compressed BCD values provide useful background on BCD terminology and packed digit storage.
API Usage Example:
POST /api/tools/conversion/bcd
Content-Type: application/json
{
"input": "123",
"mode": "decimal-to-bcd",
"outputFormat": "nibbles",
"inputFormat": "nibbles"
}