进制转换器
在 2 到 36 之间的任意进制之间转换数字——二进制、八进制、十进制、十六进制等。
Programmers regularly encounter numbers in bases other than 10: memory addresses in hexadecimal, file permissions in octal, network masks in binary, and custom encoding schemes in unusual bases. Mentally converting between them is slow and error-prone. A reliable base converter removes that friction, letting you focus on what the number means rather than its representation.
This tool converts any integer between base 2 and base 36, covering every base used in practice — binary, octal, decimal, hexadecimal, base32, base36, and everything in between. Paste a value, select its source base, and see the result in all common bases simultaneously. Useful for embedded development, cryptography, colour manipulation, and understanding compiler or assembler output.
如何在线转换数字进制
- 1
输入数字和源进制
输入一个数字并选择其进制(2-36)。二进制、八进制、十进制和十六进制是常用预设。
- 2
查看所有表示形式
二进制、八进制、十进制和十六进制输出同时更新。输入自定义目标进制可进行任何其他转换。
- 3
处理大数
工具使用 JavaScript BigInt 进行任意精度整数运算。64 位及更大的值转换不会损失精度。
How Base Conversion Works
Every positional numeral system represents an integer as a sum of digit values multiplied by powers of the base. The digits used for bases above 10 are the lowercase letters a–z, so base 16 uses 0–9 and a–f, and base 36 uses 0–9 and a–z — giving 36 distinct symbols. To convert from any base to another, the standard algorithm first converts the input string to a native integer by accumulating `digit * base^position` for each digit, then repeatedly divides that integer by the target base, collecting remainders as the output digits from least significant to most significant.
For large numbers, arbitrary-precision arithmetic is required — JavaScript's native numbers lose precision beyond 2^53, so this tool uses BigInt internally to handle arbitrarily large integers without rounding errors.
为什么使用 FileCrank 进制转换器?
- ✓ 在 2 到 36 之间的任意两个进制之间转换。
- ✓ 同时显示二进制、八进制、十进制和十六进制。
- ✓ BigInt 支持,用于任意精度的大整数。
- ✓ 完全在浏览器中运行——不向任何服务器发送数据。
功能与规格
常见问题
此转换器可以处理哪些进制?
2 到 36 之间的任意整数进制。2 进制是二进制,8 进制是八进制,10 进制是十进制,16 进制是十六进制。11 到 36 进制使用字母 A-Z 表示大于 9 的数字。
此转换器可以处理大数而不损失精度吗?
可以。工具使用 JavaScript BigInt 进行所有计算,支持任意大小的整数。标准 JavaScript Number 在超过 2^53 - 1(约 9 千万亿)时会损失精度。
为什么在十六进制输入中输入 G 会报错?
有效的十六进制数字是 0-9 和 A-F(不区分大小写)。G 不是有效的十六进制数字。工具会在行内高亮显示无效字符。
此工具与二进制、十六进制和八进制转换器有什么区别?
进制转换器专注于任意两个进制之间的纯数值转换。二进制、十六进制和八进制转换器还显示输入的文本(字符)表示——它们对字符串操作,而不仅仅是数值。
Browser Converter vs. Python int() vs. Programmer Calculator
Python's `int('ff', 16)` and `bin()` / `hex()` / `oct()` functions handle common bases elegantly, but require a REPL and only cover bases 2, 8, 10, and 16 natively. The Windows Programmer Calculator covers binary, octal, decimal, and hex but caps at 64-bit integers and is not available on every platform. A browser-based converter supports all bases 2–36, works on any OS, and shows all representations at once for quick cross-reference.
相关工具
FileCrank 进制转换器使用 BigInt 精度在 2 到 36 之间的任意进制之间转换整数,同时显示二进制、八进制、十进制和十六进制,在浏览器中运行。
Advertisement