User Rating 0.0
Total Usage 0 times
Enter 0s and 1s. Spaces optional. Each 4-bit nibble maps to one decimal digit (0–9).
Quick presets:
Enter a BCD value and click Convert
Is this tool helpful?

Your feedback helps us improve.

About

Binary Coded Decimal (BCD) encodes each decimal digit as a separate 4-bit binary nibble. A raw binary-to-decimal conversion treats the entire bitstream as one positional value. BCD does not. Each nibble is independent. This distinction matters in financial systems, digital clocks, and legacy mainframe architectures where decimal precision is non-negotiable. A nibble value exceeding 10012 (910) is an invalid BCD code and signals data corruption or encoding error. This tool parses your BCD input nibble-by-nibble, flags any invalid codes with their exact position, and concatenates valid digits into the final decimal result.

Assumption: input represents unsigned, packed BCD (no sign nibble). Unpacked BCD (8 bits per digit, upper nibble zeroed) should be entered as space-separated nibbles. The tool left-pads the final leftmost group with zeros if fewer than 4 bits remain. Pro tip: if you are reading BCD from a hardware register, confirm byte order (big-endian vs. little-endian) before entering bits here.

bcd binary coded decimal decimal converter bcd to decimal binary conversion number systems digital electronics

Formulas

Each BCD nibble is converted independently using positional binary weighting:

d = b3 × 8 + b2 × 4 + b1 × 2 + b0 × 1

where b3b2b1b0 are the 4 bits of the nibble (MSB to LSB) and d is the resulting decimal digit. The validity constraint is:

0 d 9

The full decimal number is the concatenation of all nibble results read left to right:

D = d1 || d2 || || dn

where || denotes string concatenation (not addition). D = final decimal output. n = total number of nibbles.

Reference Data

Decimal DigitBCD NibbleBinary ValueHexValid BCD
0000000x0
1000110x1
2001020x2
3001130x3
4010040x4
5010150x5
6011060x6
7011170x7
8100080x8
9100190x9
101010100xA✗ Invalid
111011110xB✗ Invalid
121100120xC✗ Invalid
131101130xD✗ Invalid
141110140xE✗ Invalid
151111150xF✗ Invalid

Frequently Asked Questions

Nibble values from 1010 through 1111 (decimal 10 - 15) are not valid in BCD encoding. This tool flags each invalid nibble by position and highlights it in the step-by-step breakdown. The conversion still processes valid nibbles but marks the overall result as containing errors. In hardware, these codes sometimes serve as sign indicators in signed BCD (e.g., 1100 for positive, 1101 for negative), but this tool treats them as invalid per standard unsigned packed BCD.
If the total number of binary digits is not divisible by 4, the tool left-pads the leftmost nibble with leading zeros. For example, an input of 10001 (5 bits) becomes 0001 0001, which converts to decimal 11. This matches the standard convention where the most significant nibble may be shorter.
Standard binary treats the entire bit string as one number with positional weights (20, 21, 22, …). BCD segments the string into 4-bit groups, each representing one decimal digit independently. For instance, decimal 59 in binary is 111011 (6 bits), but in BCD it is 0101 1001 (8 bits). BCD is less space-efficient but preserves exact decimal digit mapping, which is critical in financial and metering applications.
Yes. The tool accepts both continuous strings (e.g., 010010010) and space-separated nibbles (e.g., 0100 1001 0000). Spaces are stripped before processing. This is useful when copying BCD values from datasheets or register dumps that format nibbles with whitespace.
Standard packed BCD as implemented here is unsigned and integer-only. Signed BCD variants exist (e.g., IBM mainframe packed decimal uses a sign nibble at the end: 1100 for +, 1101 for −). Fixed-point BCD places an implied decimal point at a known nibble boundary. This tool does not interpret sign nibbles or fractional points. Enter only the digit-bearing nibbles.
BCD eliminates rounding errors inherent in binary floating-point conversion of decimal fractions. Financial regulations (e.g., IEEE 754-2008 decimal formats) and utility metering standards require exact decimal representation. Legacy systems (COBOL, IBM System/360) encode all numeric data in BCD. Seven-segment display drivers decode BCD nibbles directly without division or modulo operations, reducing hardware complexity.