数字进制转换器
在二进制、八进制、十进制、十六进制以及 2 到 36 之间的任意进制之间转换数字。
0b
0o
0x
Tip: Edit any field and all others will update automatically. Supports negative numbers.
数字进制系统 - 技术详情
数字进制定义了用多少个唯一数字来表示值。二进制(2 进制)使用 0-1,八进制(8 进制)使用 0-7,十进制(10 进制)使用 0-9,十六进制(16 进制)使用 0-9 和 A-F。任何 2 到 36 之间的进制都可以使用数字和字母表示。
命令行替代方案
# Convert in terminal (using printf)\nprintf '%d\\n' 0xFF # Hex to decimal\nprintf '%x\\n' 255 # Decimal to hex\nprintf '%o\\n' 255 # Decimal to octal\n\n# In Python\nbin(255), oct(255), hex(255)