Math & Number Utilities100% Client-Side

Encode Decimal Digits as 8421 BCD

Paste a non-negative decimal integer to write its digits in 8421 binary-coded decimal. The tool maps each decimal digit independently to a four-bit group and keeps the order of the source. Leading decimal zeroes are retained as full groups. This is useful for preparing a fixture that expects digit-by-digit encoding rather than the bit pattern for the whole integer in ordinary binary.

Input
2 chars•1 lines
Output

Reverse tool

BCD to Decimal Digit Converter

Convert unsigned 8421 BCD to its decimal digits. Decode each four-bit group and keep leading zeroes when inspecting a padded decimal field in a test.

Open BCD to Decimal Digit Converter
Example input
0100 0010
Example output
42

How to Use the Decimal to 8421 BCD Converter Online

  1. 1Paste one non-negative whole number written in decimal.
  2. 2Check the decimal value represented by the input if the source uses another base.
  3. 3Read every group of four bits as one digit in that decimal value.
  4. 4Copy the grouped result and compare each decimal position against the expected layout of a fixture.

Input & Output Examples

The magnitude is 42 in decimal, so the displayed result is its bcd representation.

Input Sample
42
Expected Output
0100 0010

The underscore is a separator. Each of the four decimal digits produces one four-bit group, including the two leading zeroes.

Input Sample
00_50
Expected Output
0000 0000 0101 0000

Practical Developer Workflows

  • Build a BCD fixture for a decimal field that preserves a fixed number of digits.
  • Confirm the separate bit groups for the tens and ones digits of an example.
  • Compare a padded decimal label with its expected digit-by-digit representation.

Zero Server Uploads & Complete Privacy

Runs 100% in your browser; no data is uploaded to any server.

Notice a bug, calculation error, or outdated info?

Let us know directly so our engineering team can fix it.

Frequently Asked Questions

The encoder writes a full 0000 group for each one. For example, 05 produces 0000 0101. This allows a corresponding decoder to recover the original digit count as well as the value.

Explore Other Tools

12 suggested tools

View all tools