BCD Converter
Convert decimal numbers to Binary-Coded Decimal (BCD) and back. Shows the 4-bit group encoding for each decimal digit — useful for electronics and embedded systems.
BCD
0010 0101 0110
How to use the bcd converter
Enter a non-negative decimal integer. Each digit is encoded in 4 bits independently.
Formula & explanation
BCD (binary-coded decimal) keeps each base-10 digit as its own 4-bit nibble — wasteful but useful when you need digit-by-digit display.
Examples
256 → 0010 0101 0110.
Frequently asked questions
- What is BCD (Binary-Coded Decimal)?
- BCD encodes each decimal digit separately as a 4-bit binary group rather than converting the whole number to binary. For example, 9 in BCD is 1001, whereas in regular binary it might share bits with adjacent digits.
- Where is BCD used?
- BCD is common in digital clocks, calculators, and financial systems where exact decimal digit display is required and floating-point rounding is unacceptable.
- How is BCD different from regular binary?
- Regular binary converts the entire number at once (e.g., 12 = 1100). BCD converts each digit independently (1 = 0001, 2 = 0010), so 12 in BCD is 0001 0010.
- Why is BCD considered wasteful?
- Each 4-bit group can represent 0–15, but BCD only uses 0–9, leaving 6 unused bit patterns per digit. This uses more storage than pure binary but makes decimal display straightforward.
Related number & code tools
- Binary ⇄ DecimalConvert between binary and decimal numbers in both directions. Supports signed integers and shows the step-by-step positional value breakdown for each conversion.
- Hex ⇄ DecimalConvert between hexadecimal and decimal numbers. Supports uppercase and lowercase hex input — useful for color codes, memory addresses, and network protocols.
- Binary ⇄ HexConvert between binary and hexadecimal notation. Handles any length input and groups binary output into nibbles (4-bit groups) for readability.
- Octal ⇄ DecimalConvert between octal (base 8) and decimal (base 10). Useful for Unix file permissions, legacy computing, and programming exercises involving number systems.
- Number Base ConverterConvert any number between any two bases from 2 (binary) to 36. Enter the source base, target base, and number — ideal for computer science and custom encoding schemes.
- ASCII ConverterConvert text to ASCII character codes and ASCII codes back to text. Shows decimal, hexadecimal, and binary representations for each character simultaneously.