任意進数変換
変換結果
各進数での表記 (2〜36)

任意基数コンバーター

Convert a number between binary, octal, decimal, hex and any base from 2 to 36, with every base shown at once on the right.

It uses big-integer math, so even very long numbers keep full precision; input may carry 0x / 0b / 0o prefixes, and "Auto-detect" infers the source base from the prefix and characters.

Features

How to use

  1. Enter a value on the left (e.g. 255, 0xFF, 0b1010, 1f).
  2. Choose the source base (leave Auto-detect if unsure) and the target base.
  3. The converted value shows on the left; every base 2-36 is listed on the right.

FAQ

Why is big-number conversion exact?

Plain math uses floats and loses precision past 2^53; here every digit is processed with big-integer arithmetic, so the result is exact.

How does Auto-detect decide the base?

0x means hex, 0b binary, 0o octal; all-digit input is decimal; input with a-f but no prefix is treated as hex.

Are fractions supported?

Only integers for now; fractional base conversion is error-prone and rarely needed.

Does this page collect my data?

No. The content is either baked into the HTML at build time or every calculation runs locally in your browser, so your input is never sent to any server. Apart from the footer traffic counters (Baidu Analytics and our self-hosted visitor counter, see the privacy policy), this site collects nothing about your visit.

How do I convert decimal to binary by hand?

Divide repeatedly by 2 and read the remainders bottom-up: 156 gives 0, 0, 1, 1, 1, 0, 0, 1, so the answer is 10011100. The reverse direction is quicker with place values - 128 + 16 + 8 + 4 lands on the same byte without any division.

What is the difference between base 2, 8, 10 and 16?

Only the size of the digit set changes. Base 2 uses two digits, base 8 eight, base 10 ten and base 16 sixteen (0-9 plus A-F). One hex digit maps exactly to four binary bits and one octal digit to three, which is why those two are used as shorthand for binary.

Why does base64 look like a number base but is not one?

Base64 is not positional notation - it groups bytes into six-bit chunks and maps each chunk to one of 64 printable characters so binary data can travel through text channels. The value does not grow or shrink by a factor of 64, it only grows by about a third through padding.

How do I convert a negative number or a fraction?

Negative integers are stored in two's complement, so -1 in a 32-bit word is all ones, not a minus sign. Fractions use negative powers of the base after the point, and many decimal fractions - 0.1 for instance - repeat forever in binary, which is why float comparisons need a tolerance.

Related tools & reading

フィードバック

このサイトはフロントエンドのみでバックエンドやアカウントはなく、フィードバックはGitHub Issues・ディスカッション・メールで受け付けています。

issueやメールに貼り付けていただくと問題特定が早まります。入力内容は含まれません

その他:既存の報告を見る · メールでのフィードバック(GitHubアカウント不要):278975598@qq.com