文本到八進位

輕鬆將文本轉換為八進位表示

轉換器工具

0 characters

Enter text to convert to octal. Choose between UTF-8 (supports all characters) and ASCII (only 128 characters). Spaces between octal values can be added or removed.

換算表:

Character UTF-8 代碼 八進位值

關於文字到八進位的轉換

文本編碼

文字字元在計算機中由數位表示。不同的編碼系統對字元使用不同的數位:

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 相同。

轉換過程

將文字轉換為八進位涉及以下步驟:

  1. Determine the numerical value of each character using the chosen encoding (ASCII or UTF-8).
  2. Convert each numerical value to its octal (base-8) representation.
  3. (可選)用空格分隔每個八進位值以提高可讀性。

範例:將 「Hi」 轉換為 Octal

Step 1: Convert each character to its numerical value (ASCII):

H → 72

i → 105

第 2 步:將每個數值轉換為八進位:

72 → 110 (in octal)

105 → 151 (in octal)

Step 3: Combine the octal values (with spaces):

110 151

使用說明

  • 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字元使用多個字節,則它可以由多個八進位值表示。
  • Octal 值通常用於計算文件許可權和一些舊系統。

Related Tools