Hex to BCD Converter
Convert hexadecimal to Binary-Coded Decimal online. See the intermediate decimal step and 4-bit BCD encoding.
Paste hex values like FF or 0x2B and get back 4-bit BCD nibbles for each decimal digit, with the intermediate decimal step shown so you can verify the math. Handy when debugging RTC chips, BIOS clock registers, or any embedded code that stores numbers as packed BCD instead of plain binary. And everything runs in your browser. Nothing gets uploaded.
How to Use
Enter hex values in the left panel, one per line. Supports 0x prefix and bare hex strings.
Choose BCD separator -- space, dash, or none between the 4-bit BCD nibbles.
Enable "Show steps" to see the intermediate decimal value for each conversion.
Click Convert or leave Live mode on for instant results. Copy the output when done.
Frequently Asked Questions
What is BCD (Binary-Coded Decimal)?
BCD is a class of binary encoding where each decimal digit (0-9) is represented by a fixed number of binary bits, usually four. For example, the decimal number 42 becomes 0100 0010 in BCD -- the digit 4 is encoded as 0100 and the digit 2 as 0010. Unlike pure binary where 42 = 101010, BCD preserves the individual decimal digit structure.
How does hex to BCD conversion work?
The conversion is a two-step process: first, the hexadecimal value is converted to its decimal equivalent (e.g., hex FF = decimal 255). Then each decimal digit is encoded individually as a 4-bit BCD value (2 = 0010, 5 = 0101, 5 = 0101). So hex FF becomes BCD 0010 0101 0101.
What is the difference between BCD and regular binary?
Regular binary represents the entire number as a single binary value (e.g., decimal 99 = binary 1100011). BCD represents each decimal digit separately using 4 bits (decimal 99 = BCD 1001 1001). BCD uses more bits but makes it easier to convert back to decimal for display purposes, which is why it is commonly used in digital clocks and calculators.
Can large hex values be converted to BCD?
Yes, this tool handles hex values of any practical size. JavaScript can accurately represent integers up to 2^53 - 1 (about 9 quadrillion). For values within this range, the conversion is exact. Each hex value is first converted to decimal, then each decimal digit is individually encoded as 4-bit BCD.
What are common uses for BCD encoding?
BCD is widely used in systems where exact decimal representation matters. Common applications include financial calculations (avoiding floating-point rounding), digital clock displays, calculators, BIOS real-time clocks, and embedded systems where decimal readability is important. It is also used in some database systems for precise decimal arithmetic.