BCD (Binary-Coded Decimal) Converter
Convert between decimal numbers and packed binary-coded decimal (BCD), where every decimal digit is stored in its own 4-bit nibble.
Mode
How does this calculator work?
BCD stores each decimal digit in its own 4-bit nibble (0-9 = 0000-1001). To encode, write each digit as 4 bits and concatenate; to decode, split the bits into 4-bit groups and read each as one digit. Patterns 1010-1111 are invalid and flagged.
Formula
How this is calculated
Binary-coded decimal stores each decimal digit separately in a group of four bits called a nibble. Only the patterns 0000 through 1001 (0-9) are legal; the six patterns 1010 through 1111 are unused and flagged as invalid. In Decimal -> BCD mode, the calculator reads each digit of the whole number you enter and writes its 4-bit code, then concatenates the nibbles into the packed BCD bit string.
In BCD -> Decimal mode, the input bit string is left-padded with zeros to a multiple of four and split into 4-bit groups. Each group is read as a single decimal digit (its binary value). If any group exceeds 1001 it is not valid BCD, so that digit is shown as "?" and the invalid-nibble flag is raised.
The tool reports the packed binary, the equivalent hexadecimal (each nibble becomes one hex character, which for valid BCD equals the original digits), and the digit/nibble count. Inputs must be a non-negative whole number (BCD has no sign or fractional part here) for encoding, or a pure binary string for decoding; empty or malformed input shows a warning.
Frequently asked questions
Plain binary encodes the whole number as one value, while BCD encodes each decimal digit independently in 4 bits. So 12 is 1100 in binary but 0001 0010 in BCD.
A nibble has 16 patterns but BCD only uses 0000-1001 for digits 0-9. The patterns 1010-1111 (10-15) are not valid BCD digits, so the converter flags them.
This packed-BCD tool encodes non-negative whole numbers only. Signs and fractional parts require additional conventions (such as sign nibbles) that are outside this basic converter.
Also known as
TG we-Calculate Editorial Team. (2026). BCD (Binary-Coded Decimal) Converter [Online calculator]. TG we-Calculate. https://we-calculate.com/calculator/bcd-binary-coded-decimal-converter
TG we-Calculate Editorial Team. "BCD (Binary-Coded Decimal) Converter." TG we-Calculate. 2026. https://we-calculate.com/calculator/bcd-binary-coded-decimal-converter.
TG we-Calculate Editorial Team, "BCD (Binary-Coded Decimal) Converter," TG we-Calculate, 2026. [Online]. Available: https://we-calculate.com/calculator/bcd-binary-coded-decimal-converter
@misc{wecalculate_bcd_binary_coded_decimal_converter, title = {BCD (Binary-Coded Decimal) Converter}, author = {{TG we-Calculate Editorial Team}}, howpublished = {\url{https://we-calculate.com/calculator/bcd-binary-coded-decimal-converter}}, year = {2026}, note = {TG we-Calculate} }
Did this calculator help you?
