基数変換器
様々な基数間で数値を変換
最終更新:
ツールについて
基数変換ツールは整数を 10 進・2 進・8 進・16 進の間で変換します。メモリアドレスや HTTP バイト数の確認には 16 進、ビットフラグの操作には 2 進、Unix のパーミッション設定には 8 進が使われます。
使い方
- Type a number into any of the four fields — decimal, binary, octal, or hex.
- The other three fields update automatically with the equivalent representation.
- Click Copy on any row to grab that representation for your code or terminal.
- Use the leading 0x prefix as appropriate when pasting into source code.
- Watch for invalid input warnings if you mix incompatible characters (e.g., 9 in binary).
主な使用例
- Reading a memory address from a stack trace and finding the decimal offset.
- Translating Unix file permissions between symbolic (rwxr-xr-x) and octal (755) form.
- Decoding a network packet field given as hex into the underlying integer value.
- Working with bitmask flags by viewing the binary representation.
- Converting an RGB channel value (0–255) into the hex pair used in a CSS color.
- Checking that a hex constant in your code matches the decimal value in a spec.
よくある質問
Q. Why does 10 in hex equal 16 in decimal?
A. Hex (base 16) digits go 0-9 then A-F. Position values are 16⁰, 16¹, … so "10" hex means 1×16 + 0 = 16.
Q. Are negative numbers supported?
A. For most calculator use the tool sticks to non-negative integers. Negative values in binary need an explicit width and two-complement encoding, which differs by platform.
Q. How big a number can I convert?
A. JavaScript handles integers up to 2^53 - 1 safely. Beyond that you need BigInt; this tool focuses on the typical 32/64-bit range.
Q. Why does the hex representation use uppercase letters?
A. Convention only. Lowercase is equally valid (and what JavaScript .toString(16) produces by default). Many specs and tools display uppercase for readability.