การป้อนเลขฐานสิบหก
การป้อน code point Unicode โดยตรงด้วยการพิมพ์ค่า hex Mac: กด Option ค้างไว้ + hex + ปล่อย Windows: พิมพ์ hex แล้วกด Alt+X ใน Word/WordPad
What is Hex Input?
Hex input refers to methods for entering a Unicode character by typing its hexadecimal code point value directly. Instead of navigating a character picker or memorizing keyboard shortcuts, you type the four- or five-character hex representation of a character's Unicode value and invoke a conversion command. This gives technically proficient users direct, precise access to any of the 1,114,112 possible Unicode code points.
Hex Input Methods by Platform
macOS: Unicode Hex Input Keyboard
macOS provides a built-in "Unicode Hex Input" keyboard layout that maps Option + hex digits to the corresponding Unicode character:
- Go to System Settings → Keyboard → Input Sources → Add… → Other → Unicode Hex Input
- Switch to this input method (via menu bar or keyboard shortcut)
- Hold Option and type the 4-hex-digit code point: Option + 0 0 E 9 → é
For code points beyond U+FFFF (5 hex digits), type a leading zero to pad to 8 digits, or the system accepts 5-digit entries directly.
Windows: Alt+X in Microsoft Applications
In Microsoft Word, WordPad, and some other Windows apps:
1. Type the hex code point: 2014
2. Press Alt+X
3. The code is converted to the character: —
This works bidirectionally — place the cursor after a special character and press Alt+X to see its hex code point.
Linux: GTK Ctrl+Shift+U
In GTK applications (including most GNOME apps, gedit, Firefox on Linux):
1. Press Ctrl + Shift + U
2. Type the hex code point (an underlined u appears as a prompt)
3. Press Enter or Space
4. The character is inserted
Ctrl+Shift+U → type "2026" → Enter → …
Ctrl+Shift+U → type "1F600" → Enter → 😀
Terminal and Programming
In terminal emulators and programming contexts, Unicode characters are entered via escape sequences:
# Bash: $'...' ANSI-C quoting
echo $'\u00e9' # é
echo $'\U0001F600' # 😀 (capital U for > U+FFFF)
# Python
print("\u00e9") # é
print("\U0001F600") # 😀
# JavaScript
"\u00e9" // é
"\u{1F600}" // 😀 (ES6 syntax for > U+FFFF)
# CSS
content: "\00e9"; /* é */
content: "\1F600"; /* 😀 */
Hex vs. Decimal Code Points
Unicode code points are conventionally written in hexadecimal, prefixed with U+. The decimal equivalent is rarely used in Unicode contexts (unlike the old Windows Alt codes which used decimal).
| Hex (U+) | Decimal | Character |
|---|---|---|
| U+00E9 | 233 | é |
| U+2026 | 8230 | … |
| U+2014 | 8212 | — |
| U+1F600 | 128512 | 😀 |
Finding a Character's Hex Value
- macOS Character Viewer: shows Unicode code point in the detail panel
- Windows Character Map: shows code point in status bar
- Python:
hex(ord('é'))→'0xe9' - JavaScript:
'é'.codePointAt(0).toString(16)→'e9' - UnicodeFYI.com: search by character, name, or description
Quick Facts
| Property | Value |
|---|---|
| Unicode hex prefix | U+ (e.g., U+2026) |
| macOS hex input method | "Unicode Hex Input" keyboard + Option + hex digits |
| Windows hex input | Type hex + Alt+X (Microsoft apps) |
| Linux GTK hex input | Ctrl + Shift + U, then hex digits, then Enter |
| Python escape | \uXXXX (BMP) or \UXXXXXXXX (full range) |
| JavaScript escape | \uXXXX or \u{XXXXX} (ES6) |
| CSS escape | \XXXXXX (hex, with trailing space if needed) |
คำศัพท์ที่เกี่ยวข้อง
เพิ่มเติมใน วิธีการป้อนข้อมูล
A system-level tool for browsing and inserting Unicode characters. macOS Character Viewer …
ส่วนประกอบซอฟต์แวร์ที่ช่วยให้ป้อนอักขระที่ซับซ้อน (CJK ภาษาเกาหลี ฯลฯ) ด้วยแป้นพิมพ์มาตรฐาน แปลงลำดับการกดแป้นเป็นอักขระผ่านการจับคู่แบบสัทศาสตร์หรือโครงสร้าง
แป้นที่ไม่ผลิตผลลัพธ์ทันทีแต่ปรับเปลี่ยนการกดแป้นถัดไป ใช้สำหรับเครื่องหมายกำกับเสียง: กด ` แล้วกด e จะได้ è พบทั่วไปในรูปแบบแป้นพิมพ์ยุโรป
ส่วนประกอบ UI (แบบ native หรือบนเว็บ) สำหรับเรียกดูและเลือกอักขระด้วยสายตา ตัวเลือก emoji บนอุปกรณ์มือถือเป็นตัวอย่างที่พบบ่อยที่สุด
แป้น (มักเป็น Alt ขวาหรือที่กำหนดเอง) ที่เริ่มลำดับการรวมหลายแป้น เป็นคุณสมบัติของ Linux/Unix: Compose + a + e …
วิธีการป้อนข้อมูลของ Windows โดยใช้ Alt + ตัวเลขจาก numpad เพื่อพิมพ์อักขระตามหมายเลขหน้าโค้ด (Alt+0169 → ©, Alt+0176 …
วิธีการใดก็ตามในการป้อนอักขระโดยใช้ code point Unicode ได้แก่ การป้อน hex (Mac) การป้อน U+XXXX ผ่าน Ctrl+Shift+U …
ยูทิลิตี GUI สำหรับเรียกดูและแทรกอักขระ Unicode Windows: charmap.exe Mac: Character Viewer (Control+Command+Space) Linux: gucharmap