企评社

Interface labels are shown in English. Company reviews, forum posts and tool descriptions are currently available in Chinese only.

Number base converter

Binary / octal / decimal / hexadecimal / any base from 2 to 36 · exact big numbers · fractions and bit views included

全部在浏览器本地计算,不上传、刷新即清空

示例:

换算设置

整数用 BigInt 大数运算,不经过双精度浮点,40 位以上的十进制整数也逐位精确。

小数按分数精确换算:把你输入的小数位当分子、进制的幂当分母,约分后逐位乘目标进制,结果标注「精确」或「循环」。

位视图展示绝对值(可补到 8/16/32/64 位),不处理补码——需要补码请先确定位宽再手工换算。

换算结果

输入数值后这里会同时给出各进制结果。

FAQ

Do big numbers lose precision? (Why BigInt is emphasized)

They do not. Integers run entirely through BigInt arithmetic and never pass through JS Number - double-precision floating point represents integers exactly only up to 2^53, roughly 16 decimal digits. Enter a 40-digit (or longer) decimal integer directly and the binary, hexadecimal and base-36 results are exact digit for digit.

How are decimals handled? What do exact and repeating mean?

Decimals convert exactly as fractions: your fractional digits become the numerator, a power of the base the denominator; after reducing, digits are produced by multiplying the target base step by step. If the reduced denominator contains only prime factors of the target base, the expansion terminates - labeled exact (decimal 0.5 is binary 0.1, 0.9375 is 0.1111). Otherwise it loops forever - labeled repeating (decimal 0.1 is binary 0.0001100110011… endlessly) - and then it is cut at the digit count you set, clearly marked as such.

Are negatives, two's complement and bit operations supported?

Negatives are, keeping the conventional minus sign (decimal -255 is hexadecimal -FF). Two's complement and bitwise operations are out of scope: the bit view shows the binary grouping of the absolute value (paddable to 8/16/32/64 bits), not a two's-complement representation; if you need two's complement, fix the bit width yourself first - this tool will not guess it for you.

Upload? Do I strip prefixes, spaces and underscores myself?

No upload. Parsing and conversion all run in your browser; the input never leaves the machine and reloading clears it. No need to delete prefixes by hand: input starting 0x / 0b / 0o is auto-recognized and switched to base 16 / 2 / 8 (the interface says so); spaces and underscores inside numbers are ignored as grouping (0b1010_1010 equals 10101010); hexadecimal is case-insensitive.

Related tools