Decode binary-coded decimal: each 4-bit group is one decimal digit 0-9. Groups above 1001 are invalid in BCD, and the tool tells you exactly which group breaks the rule.
Show calculation steps
Processed privately in your browser — nothing you paste is uploaded, logged or stored.
Nibbles as digits
Binary-coded decimal stores each decimal DIGIT in its own four bits: 0100 0010 1001 is the digits 4, 2, 9 — the number 429. Decoding walks the groups and maps each back to a digit, rejecting any group above 1001, which cannot be a digit.
BCD is a digit encoding, not a value conversion: 429 as a pure binary VALUE is 110101101, nine bits with no digit boundaries. Confusing the two produces classic embedded bugs, especially around RTC chips.
Worked example
Input: 0100 0010 1001 0100 → 4 0010 → 2 1001 → 9 Decimal: 429 (Compare: pure binary 429 = 110101101 — different animal)
| Digit | BCD | Excess-3 |
|---|---|---|
| 0 | 0000 | 0011 |
| 1 | 0001 | 0100 |
| 2 | 0010 | 0101 |
| 3 | 0011 | 0110 |
| 4 | 0100 | 0111 |
| 5 | 0101 | 1000 |
| 6 | 0110 | 1001 |
| 7 | 0111 | 1010 |
| 8 | 1000 | 1011 |
| 9 | 1001 | 1100 |
Why hardware still speaks BCD
Real-time clocks deliver 12:59 as 0001 0010 0101 1001 so firmware can drive seven-segment displays without division; financial hardware and COBOL-era formats keep decimal digits exact through arithmetic; meters and instruments follow suit. Reading such registers as plain binary — 0x12 as 18 rather than digit-pair 1,2 — is the bug this page inoculates against.
Validation is the feature
Six of sixteen patterns are invalid in BCD (1010–1111), and the decoder names the offending group and position. Bit counts that are not multiples of four are likewise rejected with guidance to lead-pad. Silent tolerance here would just relocate the bug downstream.
Privacy
Decoding is local; the groups you paste are never transmitted.
How to use the BCD to Decimal Converter
- Paste the BCD bits – spaces between 4-bit groups are optional.
- Click "Decode BCD".
- Each group decodes to one decimal digit; the steps list every group with its digit.
- Invalid groups (1010-1111) are named with their position.
Frequently asked questions
How does BCD store a number?
One decimal digit per 4-bit group: 429 is 0100 0010 1001 – three groups for three digits. It is a DIGIT encoding, not a value conversion: 429 in pure binary is the quite different 110101101.
Why are patterns 1010 through 1111 invalid?
They would mean digits 10-15, which do not exist in decimal. Six of every sixteen patterns go unused – the price BCD pays for digit-exactness, and the tool reports exactly which group breaks the rule.
Where is BCD used today?
Financial and decimal-exact arithmetic (COBOL packed decimal, some database DECIMAL types), real-time clock chips, seven-segment display drivers, and meters – anywhere decimal digits must survive without binary rounding.
What is the storage cost versus binary?
About 20% more bits: BCD needs 4 bits per digit while pure binary needs log2(10) ≈ 3.32. 999 takes 12 BCD bits but 10 binary bits. The trade is exact decimal behaviour for density.
How does hardware add BCD numbers?
Add nibbles as binary, and when a nibble exceeds 9, add 6 to skip the invalid range and carry – the classic "add-6 correction". Vintage CPUs (6502, Z80, x86 DAA) had instructions for it.
Can a BCD string have an odd bit count?
No – decoding needs whole 4-bit groups, and the tool rejects lengths that are not multiples of four, telling you to lead-pad the first group.
Where does the decoding run?
In your browser – groups are validated and decoded locally, with nothing recorded.