二進法/十六進法/十進法変換

分解表を使って二進法、八進法、十進法、十六進法の間で数を変換します。

十進法 —
バイナリ —
十六進法 —
八進法 —
ビット長 —

結果はタイプすると更新されます。

この計算機は正しい答えを与えたか。

この計算機の情報

A binary, hex and decimal converter shows the same whole number across number bases. Computers ultimately work in binary (base 2), but programmers routinely switch between bases to make values readable: decimal (base 10) for everyday quantities, hexadecimal (base 16) for byte values and memory addresses, and octal (base 8) for things like Unix file permissions. This converter takes a whole number in any of those four bases and shows it in all four at once, along with its bit length. The digits allowed in each base go up to one less than the base — binary uses 0–1, octal 0–7, decimal 0–9 and hex 0–9 then A–F for 10–15 — and the tool rejects digits that are out of range for the base you pick.

As a worked example, the decimal value 255 is FF in hexadecimal, 377 in octal and 11111111 in binary — eight bits all set, i.e. exactly one byte at its maximum. To convert decimal to hex by hand you repeatedly divide by 16 and read the remainders from last to first; the calculator does it instantly and also accepts input prefixed with 0x (hex), 0b (binary) or 0o (octal) and handles negative numbers.

The reason hexadecimal is so common in computing is that each hex digit maps to exactly four binary bits (a nibble), so two hex digits describe one byte with no ambiguity — which is why colour codes like #FF8800, MAC addresses and memory dumps are written in hex. This tool is handy for bit masks, colour values, debugging register contents and any low-level work where you need to see the same number across bases.

よくある質問

十進法から十六進法に変換するにはどうしますか?

Repeatedly divide by 16 and read the remainders from last to first, using A–F for 10–15. Decimal 255 is FF in hex and 11111111 in binary.

なぜ計算に十六進法を使うのか。

Each hex digit maps to exactly four binary bits, so hex is a compact, readable way to write byte values and memory addresses — 0xFF is one byte of all ones.

0x、0b、0o のプレフィックスを持つ数字を入力できますか?

はい。先頭の 0x (十六進法)、0b (二進法)、0o (八進法) プレフィックスは自動的に削除されます。コードから直接値を貼り付けることができます。選択した入力基数が入力した数字に一致するか確認してください。

ビットの長さは何を示す?

値が必要とする二進数の数です。十進法 255 は 8 ビット (1 バイト) で、256 は 9 ビットです。ビット長はデータタイプを選択する際に役立ち、値がバイト、16 ビットワード、32 ビットレジスタに入るかどうかを確認するのに役立ちます。

八進法は何に使われる?

八進法はビットを 3 個に分割し、主に Unix ファイル権限 (例えば 755 や 644) や いくつかの古いシステムで見られます。 各八進数字は 16 進数の 4 桁にマッピングするように、 二進数の 3 桁にマッピングします。

なぜ「この基地の番号が無効です」と表示されるの?

入力した数字は選択した基数では許可されていません。例えば、文字 F や 2 進数の数字 8 は 0 と 1 のみを許可します。入力基数を変更して、入力した値に合わせまたは範囲外の数字を修正してください。

❤️ ラブ Calculator.Free? 分けて

𝕏  X Facebook Reddit
API — コードからこの計算機を使う

この計算機を自由な JSON エンドポイントとして呼び出します。鍵は必要ありません。下のフィールド値をクエリパラメータまたは JSON として送信してください。 省略したものは、このページに既に入力されているデフォルトと同じ値を使用します。未知のパラメータは 400 で、サイレンスゼロはありません。 API ドキュメントを読む →

エンドポイント

GET https://calculator.free/api/v1/binary-hex/

curl

curl "https://calculator.free/api/v1/binary-hex/?value=255&base=10"

JavaScript fetch()

const r = await fetch(
  "https://calculator.free/api/v1/binary-hex/?" + new URLSearchParams({
    "value": "255",
    "base": "10"
  }));
const data = await r.json();
console.log(data.results);

結果は一般的な指導のための推定であり,財務的,医療的または税務的な助言ではない。