BCD Converter (Binary-Coded Decimal)
Binary-coded decimal (BCD) encodes each decimal digit in its own 4-bit group instead of converting the whole number to binary. The number 2026 becomes 0010 0000 0010 0110 — one nibble per digit. BCD keeps the decimal digits visible, which is why it shows up in seven-segment displays, real-time clock chips, calculators and financial hardware where exact decimal rounding matters. The cost is wasted bit space and the fact that nibble values 1010-1111 are illegal. This tool converts a decimal number into its 8421 BCD bit pattern and packed-BCD hex bytes, and converts a BCD bit string back to decimal, rejecting any nibble above 9.
20260010 0000 0010 011020 26BCD encodes each decimal digit in its own 4 bits (8421). Nibbles 1010-1111 are illegal. Packed BCD stores two digits per byte.
How to use
- Choose whether your input is a decimal number or a BCD bit string.
- Type the value; the decimal, BCD binary and packed-BCD hex update instantly.
- Each decimal digit is shown with its 4-bit nibble below the result rows.
Frequently asked questions
- How is BCD different from plain binary?
- Plain binary converts the whole number at once (2026 = 11111101010). BCD encodes each decimal digit separately in 4 bits (2 0 2 6 = 0010 0000 0010 0110), so the decimal digits stay readable.
- What is packed BCD?
- Packed BCD stores two decimal digits per byte — one digit in the high nibble, one in the low. So 2026 packs into the hex bytes 20 26. It is the common storage form in RTC chips and older CPUs.
- Why is 1010 not valid BCD?
- A nibble can only represent decimal digits 0-9 (0000-1001). The patterns 1010 through 1111 (10-15) have no decimal digit, so they are invalid in standard 8421 BCD.
- Where is BCD used?
- Seven-segment LED displays, real-time clock and calendar chips, pocket calculators, and any system that must show or round numbers in exact decimal without binary fraction error.
Related tools
Number Base Converter
Convert numbers between binary, octal, decimal, and hexadecimal.
Gray Code Converter
Convert between decimal, binary and reflected-binary Gray code, both directions, with an optional fixed bit width and a 0-7 reference table.
Byte Size Converter (KB / KiB / MB / MiB / ...)
Convert between decimal (KB, MB, GB — SI base 1000) and binary (KiB, MiB, GiB — IEC base 1024) byte units, plus bits.
IPv4 Address Converter
Convert an IPv4 address between dotted-decimal, 32-bit integer, hex and binary — and see whether it's private, public, loopback and more.
Bitwise Calculator
AND, OR, XOR, NOT and bit shifts on two integers — shown in binary, hex, unsigned and signed decimal, with selectable 8, 16, 32 or 64-bit width.
ASCII Code Table
Browse and search the 256-row ASCII / extended-ASCII table — decimal, hex, octal, binary, and the named control characters.