Decimal ⇄ binary coded decimal in 8421 code, with packed view, hex and per-digit nibbles, all in your browser
- Runs locally
- Category Developer & DevOps
- Best for Formatting, validating, shrinking, or inspecting code-adjacent text.
Direction
Per-digit breakdown
Each decimal digit maps to one 4-bit nibble (8-4-2-1 weighting). BCD keeps decimal exact for displays and money, while plain binary packs tighter but loses base-10 cleanliness. Everything runs in your browser tab.
What this tool does
Free BCD converter for binary coded decimal in the 8421 weighting. Type a decimal number and every digit turns into its own 4-bit group, so 1995 becomes 0001 1001 1001 0101. Paste BCD bits the other way and the tool reads each nibble back to a digit, rejecting illegal groups (1010 through 1111) instead of guessing. You get the grouped view, a packed view with no spaces, the packed hex form (which reads like the decimal digits), and a colour-keyed per-digit table that lines each digit up with its nibble. Optional space grouping makes long strings legible. BCD is how seven segment displays, real time clocks and a lot of financial code keep base ten exact, since it never inherits binary rounding. Everything runs in your browser, with one-click copy and a shareable link.
Tool details
- Input
- Numbers
- The page exposes text boxes, numeric controls, file pickers, or structured inputs depending on the tool.
- Output
- Live result + Copy
- The result area focuses on usable output, with copy, download, or preview actions when supported.
- Privacy
- Browser-side processing
- The main tool logic does not call an external API, so inputs normally stay in the current tab.
- Save / share
- Shareable URL state
- Key settings are encoded in the URL so another person can reopen the same setup.
- Performance budget
- Initial JS <= 9 KB
- No WASM budget is declared, keeping the tool quick to open on mobile.
- Best fit
- Developer & DevOps · Developer
- Category and role tags drive related tools, internal links, and quick fit checks.
How to use
-
1. Input
Paste or drop your content into the tool panel.
-
2. Process
Click the button. All processing is local in your browser.
-
3. Copy / Download
Copy the result or download to disk in one click.
How BCD Converter fits into your work
Use it in the small gaps between coding, reviewing, debugging, and shipping.
Developer jobs
- Formatting, validating, shrinking, or inspecting code-adjacent text.
- Preparing snippets for documentation, tickets, commits, or handoff.
- Checking a small payload quickly without switching tools.
Developer checks
- Run irreversible transforms like minify or obfuscate on a copy.
- Keep secrets out of pasted snippets unless the tool explicitly stays local.
- Use your normal tests or linter before shipping transformed code.
Good next steps
These links move the current task into a more complete workflow.
- 1 Decimal to Fraction Converter Turn 0.75 into 3/4, type 0.(3) to get 1/3, or flip a fraction back to its decimal with the repeating block marked Open
- 2 Number Base Converter Number base converter — binary, octal, decimal, hex, and any base 2-36. Bitwise too. Open
- 3 Gray Code Converter Decimal, binary and Gray code three ways, gray = n^(n>>1), one click each side, all in your browser Open
Real-world use cases
Drive a seven segment display from a microcontroller
You are pushing digits to a multiplexed LED display and the decoder chip wants one BCD nibble per digit. Type the number you want shown, read the grouped BCD, and copy each nibble into your lookup table or straight onto the data lines. The per-digit table makes it obvious which four bits belong to the tens versus the units, so you wire the display once and get it right.
Decode a real time clock register dump
An RTC chip reports hours, minutes and seconds in packed BCD, so a register reading of 0010 0011 looks wrong until you realise it is 23, not 35. Switch to BCD to decimal, paste the nibbles, and the tool tells you the actual time. When a value comes back as illegal it flags the bad nibble, which usually means you read the wrong register or the chip is in 12-hour mode.
Verify exact decimal handling in financial code
You are reviewing a routine that stores cents in packed BCD to dodge binary floating point drift. Encode a few amounts here, confirm the nibbles match what the code emits, and you have a quick oracle for unit tests. Because BCD never rounds, the encoded 10 cents is always 0001 0000, with no surprise representation error to chase.
Teach number representation in a digital logic class
Comparing plain binary against BCD is the moment students see why encodings are a design choice, not a law. Show 1995 as 11 bits of binary next to 16 bits of BCD, point at the six illegal nibbles, and let them try 1010 to watch it fail. The colour-keyed per-digit table turns the abstract rule into something they can read at a glance.
Common pitfalls
Treating a BCD string as plain binary. 0001100110010101 is 1995 in BCD but a very different value if you parse it as one binary number. Pick the right direction and feed nibbles, not a raw binary integer.
Forgetting that BCD lengths must be a multiple of four. A stray digit, like 00011, has no clean nibble boundary, so the tool rejects it. Pad groups to four bits each before decoding.
Assuming all sixteen 4-bit patterns are legal. They are not. 1010 through 1111 never appear in valid 8421 BCD, so seeing one means the data is corrupt, mis-aligned, or actually plain binary rather than BCD.
Privacy
Every conversion, encoding, decoding, the hex view and the per-digit breakdown, is plain JavaScript that runs in your browser tab. No number you type ever leaves the page and nothing is logged. The one caveat is the shareable link, which encodes your input in the query string, so a link pasted into chat records that value in the recipient server's access log. For anything sensitive, use the copy button rather than the share URL.
FAQ
Tool combos
Folks in your role tend to reach for these alongside this tool.
- Add Line Numbers Number every line of pasted text — set start, step and separator, zero-pad to align, skip blanks, or strip numbers back off — browser-only
- AES Text Encryptor Encrypt & decrypt text with a password — AES-256-GCM + PBKDF2 via WebCrypto — 100% in your browser, nothing uploaded
- Affine Cipher Encoder & Decoder Encrypt and decrypt the ax+b affine cipher with live modular-inverse check, browser-only
- Age Difference Calculator The exact gap between two birthdays — years/months/days, percentage, and the date one person is twice the other's age — browser-only