Skip to content
Hex Calculator

BCD to Hex Converter

Convert a BCD (binary-coded decimal) value into hexadecimal — unpack each decimal digit and re-encode the number in true hex.

Packed-BCD hex result
0x59
Swapnil Sanghvi

Built by

Swapnil Sanghvi

Full-Stack Web Developer & WordPress Developer

Swapnil Sanghvi is a full-stack web and WordPress developer, UI designer, and full-time freelancer who builds and maintains Hex Calculator.

BCD to Hex Converter tool preview card from Hex Calculator
Share preview: this is the card that appears when you share the BCD to Hex Converter page on social media.

Further reading: Character encoding — Wikipedia

How to Convert BCD to Hex

Each decimal digit of a BCD value becomes its own hex nibble directly — no base-16 positional math involved. 59 in packed BCD becomes the hex digits 5 and 9, written as 0x59, not the hex result of an ordinary decimal-to-hex conversion (which would be 0x3B).

BCD to Hex Example, Step by Step

59 (BCD) = 0x59

59 in packed BCD = 0x59

Decimal digits: 5   9
Hex nibbles:    5   9

Write directly as hex: 0x59
StepDescriptionResult
Read the decimal digits5, 92 digits
Write each digit as its own hex nibble5 -> 0x5, 9 -> 0x90x59

This is not the same as an ordinary decimal-to-hex conversion — 59 as a plain decimal number converts to 0x3B, not 0x59. Packed BCD keeps each digit in its own nibble instead of doing base-16 math.

Where BCD to Hex Actually Comes Up

Reading a Real-Time Clock Chip

RTC chips like the DS3231 report hours, minutes, and seconds packed as BCD nibbles — converting that raw register value to its hex representation is the first step before using it anywhere else in code.

BCD 59 (seconds) -> 0x59

Decoding a Seven-Segment Display Driver

Digital displays that drive their segments from BCD input store the digit they're showing in BCD — converting to hex helps when logging or debugging what a display controller is actually holding.

BCD 7 -> 0x07

Working With Legacy Financial Data

Older mainframe and COBOL systems represent exact decimal currency values in packed BCD to avoid floating-point rounding — converting to hex is often a step in migrating that data to modern formats.

BCD 9999 -> 0x9999

Common Mistakes When Converting BCD to Hex

  • Entering A-F as if they were valid BCD digits — BCD only uses 0-9.
  • Doing an ordinary decimal-to-hex conversion instead — 59 as a plain decimal number converts to 0x3B, but 59 in packed BCD is 0x59. The two operations aren't interchangeable even though they take the same-looking input.
  • Forgetting leading zero nibbles are still significant digits in BCD.

Why Use This Calculator Instead of Doing It by Hand

  • Validates that every nibble is a real BCD digit (0-9) before converting
  • Handles values of any length with arbitrary-precision arithmetic
  • Runs entirely in your browser — nothing you type gets sent anywhere
  • Shows decimal and binary for the same value alongside the hex result

Limitations

  • Accepts decimal digits (0-9) only, one digit per position — if you're working with strict packed-BCD hardware encoding, verify a known test value against your own reference first.

Frequently Asked Questions

How do you convert BCD to hex?

Each decimal digit becomes its own hex nibble directly — 59 in packed BCD becomes 0x59, not 0x3B (which is what a normal decimal-to-hex conversion of 59 would give). There's no base-16 math involved.

Why doesn't the BCD input accept letters A-F?

Because a valid BCD nibble only ever represents a decimal digit, 0-9 — A-F have no meaning in BCD, so a BCD value containing them is invalid by definition.

Where would I need to convert BCD to hex?

Reading raw output from a real-time clock (RTC) chip or BCD-based digital display and converting it into standard hex for use elsewhere in your code.

Is BCD to hex the reverse of hex to BCD?

Yes exactly — this page takes packed decimal digits and produces true hex; Hex to BCD does the opposite.

What's the largest BCD value this handles?

There's no fixed limit — the underlying engine uses arbitrary-precision arithmetic, so BCD values of any length convert correctly.

Does BCD to hex ever change the number of digits?

No — packed BCD maps one decimal digit to one hex nibble, so the hex result always has the same digit count as the BCD input. That's different from an ordinary decimal-to-hex conversion, which usually produces fewer digits.

Why do RTC chips store time in BCD instead of plain binary?

BCD digits map directly to what a seven-segment display or a human-readable field needs — no binary-to-decimal math required on the display side, just splitting the value back into nibbles.

Can a nibble value like 0xA ever legitimately appear in BCD data?

No — a genuine BCD field only ever uses nibble values 0-9. Seeing A-F in what's supposed to be BCD data usually means it's actually packed differently, or the data is corrupted.