Beginner

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

Choose the conversion direction
Non-negative whole number (digits 0-9)
Conversion
1295 = 0001 0010 1001 0101
Packed BCD (binary)
0001 0010 1001 0101
Hex
1295
Digit / nibble count
4
Decimal
1295
Invalid nibble (1010-1111)
No
Nibble 1 (0001)1
Nibble 2 (0010)2
Nibble 3 (1001)9
Nibble 4 (0101)5
Results are estimates for general information only and are not professional advice — always verify important results independently before relying on them. Read the full disclaimer.
Quick answer

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
Each decimal digit d (0-9) maps to a 4-bit nibble: 0->0000, 9->1001; digits are concatenated to form packed BCD.
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

bcd converter
binary coded decimal
decimal to bcd
bcd to decimal
packed bcd calculator
bcd calculator
convert bcd
bcd encoding

APA

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

Chicago

TG we-Calculate Editorial Team. "BCD (Binary-Coded Decimal) Converter." TG we-Calculate. 2026. https://we-calculate.com/calculator/bcd-binary-coded-decimal-converter.

IEEE

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

BibTeX

@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?