Binary Coded Decimal
Enter a value, then select Convert.
Same value in ordinary binary
Digit breakdown
| Side of point | Digit | 8421 bits |
|---|
8421 BCD chart
- 0
- 0000
- 1
- 0001
- 2
- 0010
- 3
- 0011
- 4
- 0100
- 5
- 0101
- 6
- 0110
- 7
- 0111
- 8
- 1000
- 9
- 1001
The six groups 1010 through 1111 are not decimal digits in unsigned 8421 BCD. Back to the converter ↑
Convert each decimal digit separately
Choose Decimal → 8421 BCD and enter a value such as 12. The result is 0001 0010, with a separate four-bit group for each digit. The digit chart provides a quick lookup; the result's expandable breakdown shows which group belongs to each entered digit.
For the reverse direction, choose 8421 BCD → decimal and enter complete groups such as 0001 0010. You may separate groups with spaces or enter an uninterrupted sequence such as 00010010. If you use spaces, each group must have exactly four bits. Without spaces, the bit count on each side of a point must be a multiple of four. Missing bits are not silently padded.
Read the 8, 4, 2, and 1 weights
Within one group, the four positions have weights 8, 4, 2, and 1. Add the weights whose bits are 1. For example, 0101 represents 4 + 1 = 5. That rule is applied separately to each decimal digit. The valid codes end at 1001, which represents 8 + 1 = 9.
The same weights do not make every four-bit value a valid BCD digit. A group such as 1100 has the ordinary binary value 12, but there is no single decimal digit 12. Enter decimal 12 in the decimal direction to obtain two valid groups; do not enter 1100 in the BCD direction expecting the same result.
Compare BCD with ordinary binary
The result compares integer inputs using two different representations of the same numeric value. Decimal 63 is 0110 0011 in BCD, while its minimal ordinary binary representation is 111111. Decimal 597 uses BCD 0101 1001 0111; the ordinary binary representation is 1001010101.
BCD spends four bits on each decimal digit, including any leading zero digits you enter. Ordinary binary uses powers of two across the whole value. The bit counts here describe these displayed representations, not a particular processor, file format, or fixed-size register.
Preserve decimal position without inventing a storage format
For 25.3, the output is 0010 0101 . 0011. The visible point separates the integer and fractional digit groups; it contributes no bits to the count. Decoding that notation returns 25.3. Similarly, 007.50 retains both leading zeros and the final zero after the point.
This is a notation for learning and checking individual digits. Actual stored decimal values need a convention for scale and, when applicable, a sign. This converter does not add a sign group, choose a byte order, or infer a protocol format. Fractional inputs do not receive an ordinary binary comparison.
Input limits and reusable results
Use at most 100 decimal digits or 400 BCD bits, excluding the point. Input text, including spaces, is limited to 1,000 characters. Decimal input accepts digits and one internal point, such as 0.5; signs, separators such as commas, and exponent notation are rejected. Invalid inputs never produce a partial conversion.
Select result highlights the complete output for your device's Copy command. Editing the input or changing direction clears the previous result until you select Convert again. Clear removes both input and output. Processing stays in your browser, and tool analytics do not include your values or converted results.
Frequently asked questions
What is binary coded decimal?
Binary coded decimal represents decimal digits individually. In the 8421 form used here, each digit from 0 to 9 has a four-bit code. This is different from converting the entire value into ordinary binary.
How is BCD different from binary?
Decimal 12 becomes 0001 0010 in BCD: one group for 1 and another for 2. The same value in ordinary binary is 1100. The integer comparison in this tool shows ordinary binary without leading zero padding, so it may use fewer bits than the BCD digit groups.
Why are 1010 through 1111 invalid?
Those four-bit values represent 10 through 15 in ordinary binary. A decimal digit can only be 0 through 9, so those six combinations are not digit codes in unsigned 8421 BCD. This converter rejects them rather than treating them as decimal digits.
Can I convert a value with a decimal point?
Yes. For example, 25.3 becomes 0010 0101 . 0011 in this page's teaching notation. The point marks the decimal position and is not an encoded bit. A real storage format must define its own scale or point convention; this tool does not produce a universal packed representation.
Does the converter preserve leading and trailing zeros?
Yes. Each entered decimal digit gets a group, including leading zeros and zeros after the decimal point. For example, 007.50 retains five digit groups and two fractional digits. The ordinary binary comparison is available only for integer inputs and represents the numeric value without preserving leading zeros.
Does it support signed packed BCD or other BCD codes?
No. This tool uses unsigned 8421 digit groups. It does not interpret sign nibbles, byte order, packed or zoned storage layouts, Excess-3, or other weighted BCD codes. Do not paste protocol data and assume it uses this page's convention.