95

This is in Windows, but answers for other operating systems can be handy to others.

Most guides say something to the effect of "hold down the Alt key and type in the code on the keypad". This works fine for decimal codes (like 65 for 'A'), but not for hexadecimal codes (like U+0041 for 'A').

Some applicatons provide other facilities that will allow hexadecimal Unicode character codes to be typed and then transformed. Word allows you to type the code (such as 200f) and then convert it to Unicode by typing Alt-X.

I'm looking for a general method of doing this that will work with the standard input.

Arjan
  • 31,511

11 Answers11

48

I found this in How to enter Unicode characters in Microsoft Windows:

I tested this on Windows XP and Windows 2003. This method works regardless of any of your language settings, but is the most cumbersome to type:

  1. Press and hold down the Alt key.
  2. Press the + (plus) key on the numeric keypad.
  3. Type the hexidecimal unicode value.
  4. Release the Alt key.

Alas, this appears to require a registry setting. It was already set on my computer, but some readers report that this method didn't work for them, and this is probably why. If you don't know what the registry is, please don't try this. Under HKEY_CURRENT_USER\Control Panel\Input Method, set EnableHexNumpad to "1". If you have to add it, set the type to be REG_SZ.

You should log off then log on after this registry change (you shouldn't need to reboot).

harrymc
  • 498,455
24

harrymc's answer is good, providing you're able/allowed to change the registry settings.

If not, you can use the Windows Calculator Accessory to convert from hexadecimal to decimal. The default mode won't do this: Windows XP and Windows Vista have a "Scientific mode, whereas Windows 7, 8, 8.1 and 10 have a "Programmer" mode.

Select Hex base, and then type in your hexadecimal number. Then change to Dec base to see the equivalent value in decimal. That's the number you need to type into your numeric keypad while holding down the Alt key.

This might depend on the input language, and you might need to prefix a zero to the decimal value.

17

On Mac OS X: open International in System Preferences, and in Input Menu select "Unicode Hex Input" to add this option to the input menu. Sounds obvious, but this is well hidden in the long list of languages, between Ukrainian and Vietnamese. When selected, hold down Option and type the 4 digit hex code.

Also on OS X: Calculator can be set to Programmer mode (Cmd-3), which allows for entering decimal, octal and hexadecimal codes, which are then displayed as ASCII or Unicode. However, Copy will give one the code, not the character equivalent(s). Anyone?

(For Windows, see How to enter Unicode characters in Microsoft Windows; for other input methods see Wikipedia.)

And here on Super User:

And to go into extremes:

Arjan
  • 31,511
9

I have written a small AutoHotkey based Unicode Input tool because I did not find a better solution. You can insert unicode characters with Shift+Ctrl+U.

Unicode dialog

Basically, it converts the entry to a unicode character and “types” it at cursor position.

It does not support 6-digit unicode characters. Also, if you have an input field where all text is selected on focus loss, all text will be overwritten (I think I remember an old Firefox version showed this behaviour).

As a reference, here the AutoHotkey source if you want to compile it by yourself:

#SingleInstance force
#Persistent
;Menu, Tray, icon, unicode.ico
Menu, Tray, nostandard ; Put the following menu items on top (default: bottom)
Menu, Tray, add, Info, InfoHandler, -10
Menu, Tray, add
Menu, Tray, standard ; Add default menu items at the bottom
return

InfoHandler:
MsgBox Press Shift+Ctrl+U to get an entry field for unicode points (see decodeunicode.org for a list).`n`nAuthor: Simon A. Eugster <simon.eu@gmail.com> / granjow.net
return

+^u::
InputBox, codepoint, Unicode code point, U+
if not ErrorLevel
    Send {U+%codepoint%}
return
9

In Ubuntu (and variants thereof, like Linux Mint) you can enter Unicode values by pressing Ctrl + Shift + U followed by the Unicode value and Enter, for example:

Ctrl + Shift + U 2 6 3 a and then Enter yields:

Text: ☺
Screenshot: Alt text

You might be able to couple this with AutoHotkey for easier input, or possible input in Windows.

JMD
  • 4,837
3

Linux (including Qt/KDE applications)

As JMD mentioned, you can hold down Ctrl-Shift, type u1f4a9, and release in order to type U+1F4A9 in GTK+ applications (including GNOME programs, Firefox, Chromium, and LibreOffice, even under KDE). Some programs also support typing in sequence Ctrl-Shift-U, 1, f, 4, a, 9, Enter.

Unfortunately, this doesn't work in Qt applications (including KDE programs, Mathematica, and VLC). For BMP characters, there is a Unicode IBus input method. To enable, open IBus preferences and add the "Other - unicode (m17n)" input method (the two packages ibus-m17n and ibus-qt4 must be installed). When the cursor is in a text area, activate the input method (using the IBus toolbar or the keyboard shortcut). While active, the input method lets you type Ctrl-Shift-U followed by 4 hex digits, to input the corresponding Unicode character. This only works for BMP characters, though.

(Tested under Ubuntu.)

Mechanical snail
  • 7,963
  • 5
  • 48
  • 67
2

On Windows 10, you can hit Win+. or Win+; to open an emoji browser:

Windows 10 emoji picker

As you can see in the above image, you can also search by simply typing.

Perhaps not exactly what you're asking, but if like me, you were looking for an easy way to type odd Unicode characters instead of using a search engine or reference table all the time, this might work for you.

Aske B.
  • 361
2

Windows - type the character code in hexadecimal

Here is how to type any Unicode character, taking as example the Euro sign (Unicode character U+20AC). It works only if the Windows Registry is first modified as described at the end of this answer:

Press the keys Alt++20AC

Step by step:

  • Press and hold down the Alt key.
  • Press the + (plus) key on the numeric keypad.
  • Type each character of the hexadecimal Unicode value in sequence: 2, 0, A and C.
  • Release the Alt key.

The example above succeeded in Windows 10, but has proved to work in many versions.

Here is how to change the Windows registry:

  • Press Windows key, type regedit.exe and press Enter to run the registry editor
  • Position on the key HKEY_CURRENT_USER\Control Panel\Input Method on the left panel. To position on it, you may simply copy/paste the key name in the search field and press Enter.
  • On the right panel, add a new Value of type String (menu Edit > New > String Value), type the name EnableHexNumpad, double-click it, set its value data to 1 and press Enter.

EDIT: you may need to restart your PC (see comments).

PS: for information, one list of hexadecimal Unicode values can be found at https://www.fileformat.info/info/unicode/index.htm.

2

It also depends where you want to use the special characters. With MS Office apps, you don't have to resort to knowing the ASCII codes for certain characters -- for example, to type a diaresis (i.e., the two dots you see above some characters in words such as naïve), in Word/Outlook/etc you can hit Ctrl + ':' (i.e., Ctrl+Shift+;) followed by 'i'.

There's a list of shortcuts available at http://word.mvps.org/FAQs/General/InsertSpecChars.htm ... just scroll down to "International Characters".

I don't know whether any non-Office apps support similar shortcuts.

Callie J
  • 679
1

For the lazy ones, following the correct answer from harrymc, you can use the command below in the CMD shell to directly edit the registry:

REG ADD "HKEY_CURRENT_USER\Control Panel\Input Method" /v EnableHexNumpad /t REG_SZ /d 1

Also remember (as noted by harrymc) a logoff or reboot might be needed.

Gruber
  • 501
-1

This works for me on Firefox on Windows 10 typing for example » which has Unicode character U+00BB.

  • Hold down ALT (and still hold)
  • Press +
  • Hold down CTRL and then type bb (leading zeroes can be left out)
  • Release CTRL and ALT

Using the additional CTRL prevents the menu bar to be activated.