16 進を 2 進に変換する方法
16 進文字列を 2 進表現に変換し、両者の関係を理解します。
问题
16 進文字列(例:ハッシュダイジェスト)を、分析や低レベルの作業のために 2 進(0 と 1)表現にする必要があります。
前提条件
- 16 進法(基数 16)の理解
- 2 進法(基数 2)の理解
ステップ
-
1. Split the hex into nibbles
Each hex digit (nibble) corresponds to exactly 4 binary bits. Split the hex string into individual characters so you can map each one independently.
入力1A输出nibbles: 1, A -
2. Map each nibble to 4 bits
Convert each hex digit to its 4-bit binary equivalent: 1 → 0001, A → 1010. Concatenate the results. Do not drop leading zeros in any nibble.
入力1A输出00011010 -
3. Verify the result
Group the binary output into bytes (8 bits) and confirm each byte matches the original hex pair. 1A in hex equals 26 in decimal, which equals 00011010 in binary.
入力00011010输出decimal: 26 ✓
期待される結果
各 16 進数字がちょうど 4 ビットに展開され、先頭のゼロが保持されたバイナリ文字列。
よくあるエラー
- Dropping leading zeros in the first nibble
- Always pad each nibble to exactly 4 bits. The hex value 0F must become 00001111, not 1111.
- Including the 0x prefix in the conversion
- Strip the 0x prefix before converting. It is a notation marker, not part of the value.
トラブルシューティング指引
- If the binary length is not 4× the hex length, you dropped a leading zero.
- Use a base converter tool to cross-check the result.
セキュリティ上の制限
- This is a pure format conversion with no security implications.
関連ツール
HEX エンコーダー
Encode text to hexadecimal online。無料、プライベート、100%クライアントサイド。 ツール
HEX デコーダー
Decode hexadecimal back to readable text online。無料、プライベート、100%クライアントサイド。 ツール
バイナリエンコーダー
Encode text to binary (base-2) online。無料、プライベート、100%クライアントサイド。 ツール
基数変換ツール
Convert numbers between any base (2-36)。無料、プライベート、100%クライアントサイド。 ツール