← All tools
BCD Encoder
Convert decimal digits to and from Binary-Coded Decimal — the digit-per-nibble encoding used in electronic displays, financial calculators and the COBOL COMP-3 packed type. Supports the natural 8421 (BCD) and Excess-3 (XS-3) variants, in both packed (two digits per byte) and unpacked (one byte per digit) layouts, with a full digit-to-nibble reference table. Pure arithmetic, in your browser.
Variant
Layout
Only the characters 0–9. In packed mode an odd digit count is left-padded with a 0 (encoded as 0 in 8421, 3 in XS-3).
Each nibble must encode a valid digit (0–9 for 8421; 3–12 / 0x3–0xC for XS-3).