🔢 十进制转 BCD 码Decimal to BCD Converter
十进制数与 BCD 码(8421 码)互相转换:每位十进制数字用 4 位二进制表示,可输出分组二进制或压缩 BCD 十六进制,也支持余 3 码。Convert decimal numbers to and from BCD (8421): each decimal digit becomes 4 bits, shown as grouped binary or packed-BCD hex, with Excess-3 as an option.
使用说明与常见问题How-to & FAQ
「十进制转 BCD 码」是什么?What is the Decimal to BCD Converter tool?
十进制数与 BCD 码(8421 码)互相转换:每位十进制数字用 4 位二进制表示,可输出分组二进制或压缩 BCD 十六进制,也支持余 3 码。Convert decimal numbers to and from BCD (8421): each decimal digit becomes 4 bits, shown as grouped binary or packed-BCD hex, with Excess-3 as an option.
如何使用「十进制转 BCD 码」?How do I use the Decimal to BCD Converter tool?
在「十进制转 BCD 码」中,把内容粘贴或输入到上方输入框,按需设置「方向」、「编码」、「输出」,结果会实时显示在下方,点击「复制结果」即可复制。例如输入「59」,得到「0101 1001」。In the Decimal to BCD Converter: Paste or type into the input box, adjust "Direction", "Code", "Output"; the result appears below instantly — click "Copy result" to copy it. Example: "59" → "0101 1001".
BCD 码和二进制有什么区别?How is BCD different from binary?
二进制把整个数转换(59 = 111011),BCD 则把每一位十进制数字分别编码成 4 位(59 = 0101 1001),便于数码管显示和精确的十进制运算,但更占空间。Binary converts the whole number (59 = 111011); BCD encodes each decimal digit separately in 4 bits (59 = 0101 1001), which suits 7-segment displays and exact decimal arithmetic at the cost of space.
什么是压缩 BCD?What is packed BCD?
每个字节放两个十进制数字,所以 8421 BCD 的十六进制写法恰好与十进制数字相同:59 → 0x59。RTC 时钟芯片常用这种格式。Two digits per byte, so 8421 BCD written in hex looks just like the decimal number: 59 → 0x59. RTC chips commonly use it.
余 3 码是什么?What is Excess-3?
每位数字先加 3 再编码,例如 5 → 1000;它是自补码,曾用于早期计算机做十进制减法。Each digit plus 3 is encoded (5 → 1000). It is self-complementing and was used for decimal subtraction in early computers.
代码或数据会被上传吗?Is my code or data uploaded?
不会。「十进制转 BCD 码」完全用 JavaScript 在本地运行,适合处理含有密钥、内部接口等敏感内容的数据。No. The Decimal to BCD Converter runs entirely in local JavaScript, so it is safe for data containing keys or internal endpoints.
「十进制转 BCD 码」免费吗?需要注册吗?Is the Decimal to BCD Converter free? Do I need an account?
「十进制转 BCD 码」完全免费,无需注册或安装,打开网页即可使用,手机和电脑都能用;输入的内容只在你的浏览器本地处理。The Decimal to BCD Converter is completely free with no sign-up or install and works on phones and desktops; what you enter is processed only in your browser.