How to use the BCD to Decimal tool
- Paste the bits into the BCD groups box. Spaces between the 4-bit groups are optional, and Example loads 0100 0101.
- Select Convert to decode the groups.
- Read the decimal digits in the Result box, one digit for every four bits entered.
- Select Copy to copy the digits, or Clear to decode another value.
How BCD to decimal decoding works
In 8421 binary-coded decimal, a decimal number is stored one digit at a time. Each digit occupies a 4-bit group, called a nibble, whose bits are worth 8, 4, 2 and 1. Decoding needs no arithmetic across groups. You read every nibble as a small binary number and write down the digit.
That independence is the point of BCD. A device can show or print a digit by looking at four wires, with no division by ten. This tool does the same thing in software: it cuts the input into nibbles, converts each to a digit and joins the digits into a string. All of it runs in your browser.
The ten valid BCD codes
Four bits have sixteen combinations, but only ten are used. The remaining six, 1010 through 1111, are not digits and make the tool stop with an Invalid digit group message.
0000 = 0 0101 = 5
0001 = 1 0110 = 6
0010 = 2 0111 = 7
0011 = 3 1000 = 8
0100 = 4 1001 = 9Worked example: a clock reading
A real-time clock that reports hours and minutes as two BCD bytes might return 0010 0011 and 0101 1001. Entered together, the four nibbles decode to 2, 3, 5 and 9: the time 23:59. A year register holding 0001 1001 1000 0100 decodes to 1984 the same way.
0010 0011 0101 1001 -> 2359
0001 1001 1000 0100 -> 1984Leading zeros, packed and unpacked BCD
The result is a digit string, not a number, so nothing is dropped. The input 0000 0000 0111 returns 007. That matters for fixed-width fields such as dates, account numbers and phone digits, where the zeros carry meaning.
The tool assumes packed BCD, in which nibbles follow one another with two digits per byte. Unpacked BCD puts one digit in the low nibble of each byte and zero in the high nibble. You can still paste it, but every other digit will be a 0: the bytes 00000100 00000101 decode to 0405.
BCD to decimal versus binary to decimal
The same bits mean different numbers under the two readings. As BCD, 0010 0011 is the digits 2 and 3, or twenty-three. As a plain binary byte, 00100011 is 32 + 2 + 1, or thirty-five. If a register value looks slightly too large after conversion, it was probably BCD decoded as binary. Use this tool for BCD fields and the Binary to Decimal tool for ordinary binary integers.
Frequently asked questions
How do I read a BCD number?
Split the bits into groups of four from the left and convert each group to a digit using the weights 8, 4, 2 and 1. For example, 0101 1001 is 5 and 9, giving 59.
What happens if a group is greater than 1001?
The conversion stops and the status line shows Invalid digit group with the offending four bits. Values from 1010 to 1111 are not decimal digits, so the data is either corrupt or not BCD.
Does the input have to be a multiple of four bits?
Yes. After spaces are removed, the bit count must divide by four. If it does not, the tool reports Enter complete groups of four bits. Add the missing leading zeros to the first group.
Are leading zeros kept in the decimal output?
Yes. Every nibble produces one digit, including zero nibbles at the start. Twelve bits always give three digits and sixteen bits always give four.
Can it decode signed packed decimal?
No. Sign nibbles such as 1100 for plus and 1101 for minus are outside the digit range and are rejected. Remove the sign nibble, decode the digits and apply the sign yourself.
How much BCD can I paste at once?
Up to 65,536 bits, which is 16,384 digits. Line breaks and spaces do not count toward the limit because they are removed before the length is checked.