BCD Converter

Encode each decimal digit as four bits.

Technology and NetUpdated 2026-11-201 min read
BCD Converter
Whole number from 0 to 99,999,999.
BCD groups
...
BCD bits...
Decimal digits...

What it does

Binary coded decimal, usually shortened to BCD, represents a decimal number by encoding each of its digits with a four bit binary pattern. The common 8421 code uses bit weights eight, four, two and one.

MIT notes on codes introduce BCD as a case where some four bit patterns are unused, and discuss how a decoder might handle them.

University of Southern California number system notes give the example of 439 in decimal becoming 0100 0011 1001 in BCD, and note that pure binary would be 110110111.

This tool converts a nonnegative integer up to 99,999,999 into BCD groups and the concatenated bit string.

BCD is still used in systems where exact decimal representation matters, such as financial calculations and some display hardware.

How to use

  1. Enter a whole number from 0 to 99,999,999.
  2. Read the four bit group for each decimal digit.
  3. Check the concatenated BCD bit string.
  4. Compare with the ordinary binary representation if you know it.
  5. Try 439 to reproduce the published example.
  6. Note that leading zeros in the input are not preserved.

Formula

For each decimal digit d, write d as a four bit binary number using weights 8, 4, 2 and 1.
digit
One decimal digit from 0 to 9.
8421
Bit weights for standard BCD.
nibble
A group of four bits representing one digit.
BCD
The concatenation of all digit nibbles.

The engine converts each character of the decimal string to its numeric digit and pads its binary form to four bits. It does not include a prefix or spacing beyond the grouped display.

Worked example

Example: 439

Input decimal number 439.

  1. The first digit 4 becomes 0100 in four bit binary.
  2. The second digit 3 becomes 0011.
  3. The third digit 9 becomes 1001.
  4. Joining them gives 0100 0011 1001.
  5. The tool reports BCD groups 0100 0011 1001 and plain bits 010000111001.
  6. Ordinary binary for 439 is 110110111, which uses fewer bits.

Reference table

BCD digits 0 through 9
DigitBCDDigitBCD
0000050101
1000160110
2001070111
3001181000
4010091001

Limits

  • Inputs are limited to 99,999,999.
  • The tool encodes integers only, not fractions.
  • It uses standard 8421 BCD, not excess-3 or other variants.
  • Leading zeros in the input are dropped.

Common mistakes

  • Assuming BCD is the same as converting the whole number to binary.
  • Entering a decimal fraction, which the tool rejects.
  • Expecting bit patterns above 1001, which are invalid in BCD.
  • Confusing BCD with ASCII digits, which use seven or eight bits.
  • Thinking BCD is more compact than binary.

Try it yourself

Quick checks. Answers sit tucked under each question.

What is 439 in BCD?

0100 0011 1001.

How many bits per digit does BCD use?

Four.

Why use BCD?

It preserves exact decimal digits for display and financial work.

Questions

What is BCD?

A binary encoding where each decimal digit gets its own four bit code.

What is 8421?

The weights of the four bits in standard BCD.

Is BCD efficient?

Less efficient than pure binary but convenient for decimal data.

Can it encode fractions?

Not with this tool, which takes integers.

Where is BCD used?

In some calculators, displays and financial systems.

What is excess-3?

A related code that adds three to each digit before encoding.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.