文本到十六進位
輕鬆將文本轉換為十六進位表示
轉換器工具
Enter text to convert to hexadecimal. Choose between UTF-8 (supports all characters) and ASCII (only 128 characters). Options to add spaces between hex values and use uppercase letters are available.
換算表:
Character | UTF-8 代碼 | Hex Value |
---|
關於文字到十六進位的轉換
文本編碼
文字字元在計算機中由數位表示。不同的編碼系統對字元使用不同的數位:
ASCII
The ASCII (American Standard Code for Information Interchange) encoding uses 7 bits to represent 128 characters, including English letters (both uppercase and lowercase), digits, and common punctuation symbols. Each ASCII character can be represented by a unique number between 0 and 127.
UTF-8
UTF-8 是一種可變長度字元編碼,可以表示 Unicode 標準中的每個字元。它為每個字元使用 1 到 4 個字節。UTF-8 向後相容 ASCII,這意味著前 128 個 UTF-8 字元與 ASCII 相同。
轉換過程
將文字轉換為十六進位涉及以下步驟:
- Determine the numerical value of each character using the chosen encoding (ASCII or UTF-8).
- Convert each numerical value to its hexadecimal (base-16) representation.
- (可選)用空格分隔每個十六進位值以提高可讀性。
- (可選)將所有十六進位字母轉換為大寫。
範例:將 「Hi」 轉換為十六進位
Step 1: Convert each character to its numerical value (ASCII):
H → 72
i → 105
第 2 步:將每個數值轉換為十六進位:
72 → 48 (in hexadecimal)
105 → 69 (in hexadecimal)
Step 3: Combine the hexadecimal values (with spaces):
48 69
使用說明
- When using ASCII encoding, any character outside the 7-bit ASCII range (128-255) will be converted to a question mark (?).
- UTF-8 編碼支援所有 Unicode 字元,包括特殊符號、表情符號和非英語語言中的字元。
- 如果每個UTF-8字元使用多個字節,則它可以由多個十六進位值表示。
- 十六進位值通常用於計算記憶體位址、顏色代碼和二進位數據表示。