SymbolFYI

Unicode Hex Input

Input Methods
คำจำกัดความ

A macOS keyboard layout that allows typing characters by their hex code point (hold Option + type hex code).

Unicode Input Methods Across Operating Systems

Unicode input refers to the ability to enter a character directly by specifying its Unicode code point, bypassing the need for a dedicated keyboard key or input method. This is essential for developers, linguists, and anyone who needs occasional access to characters outside their keyboard layout.

Windows

Using Alt+X in Microsoft Office

In Microsoft Word and some other Office applications, type the hexadecimal code point followed by Alt+X to convert it to the character:

2603  then press Alt+X   (SNOWMAN)
00A9  then press Alt+X  © (COPYRIGHT SIGN)

Using Alt Codes (Decimal)

Hold Alt and type a decimal number on the numeric keypad to insert a character from the Windows-1252 code page (for codes 0-255) or Unicode (for some ranges with registry modification).

Registry Method for Hex Input

With a registry modification, Windows can accept hexadecimal Unicode input via the numpad while holding Alt:

HKEY_CURRENT_USER\Control Panel\Input Method
EnableHexNumpad = "1" (REG_SZ)

After enabling and rebooting: hold Alt, type + on the numpad, then the hex code point.

macOS

Unicode Hex Input Keyboard

macOS includes a built-in "Unicode Hex Input" keyboard layout. Enable it in System Settings → Keyboard → Input Sources. With this layout active, hold Option and type the four-digit hex code point:

Option + 2603 → ☃
Option + 00A9 → ©

For characters above U+FFFF (requiring 5+ digits), this method does not work directly.

Character Viewer

The macOS Character Viewer (accessed via Edit → Emoji & Symbols or Ctrl+Cmd+Space) allows browsing and inserting characters by name or code point.

Linux (X11)

Ctrl+Shift+U (GTK Applications)

In GTK applications and many Linux terminals, pressing Ctrl+Shift+U enters Unicode input mode. Type the hexadecimal code point and press Enter or Space:

Ctrl+Shift+U, then 2603, then Enter  

A underlined u appears while in input mode to indicate the system is waiting for a code point.

Compose Key Sequences

The Compose key (see compose-key entry) provides a more ergonomic alternative for frequently needed characters.

Terminal and Development Environments

Shell (Bash/Zsh)

# Print Unicode character by code point
printf '\U2603\n'     # ☃ (Bash 4.2+, using \U for > U+FFFF)
printf '\u2603\n'     # ☃ (4-digit \u)
echo $'\u2603'        # ☃ (ANSI-C quoting)

Python

# By code point integer
print(chr(0x2603))   # ☃
print(chr(9731))     # ☃ (decimal)

# Unicode escape in string literals
print('\u2603')      # ☃
print('\U0001F600')  # 😀 (surrogate pair range)

JavaScript

String.fromCodePoint(0x2603)    // "☃"
String.fromCodePoint(0x1F600)   // "😀"
'\u2603'                        // "☃"
'\u{1F600}'                     // "😀" (ES2015+)

Practical Tips

  • Look up code points at sites like SymbolFYI, Unicode.org, or using python3 -c "import unicodedata; print(unicodedata.name('☃'))"
  • BMP vs. Supplementary: Characters above U+FFFF require \U (8 digits) in some contexts
  • Copy-paste: For one-off needs, copying from a reference site is often faster than memorizing input sequences

สัญลักษณ์ที่เกี่ยวข้อง

คำที่เกี่ยวข้อง

เครื่องมือที่เกี่ยวข้อง

คู่มือที่เกี่ยวข้อง