Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

The title pretty much says it all: how can I type Unicode characters - specifically the em-dash —?

share|improve this question
up vote 79 down vote accepted
  • Ctrl+Shift+U, then 2 0 1 4 and Enter

  • Ctrl+Shift+U+2014

Control-capital-u means Unicode, and the four-digit hexadecimal number for em dash (or any other Unicode character) can be found via the Character Map in Ubuntu (gucharmap).

The first option allows you to separately type the correct digits for your character, which appears upon hitting Enter or Space. You can also edit the numbers you typed using backspace before pressing Enter.

share|improve this answer
Works for me. Didn't need to press enter though, the — appears as soon as i release ctrl and shift. – Alistair Buxton Mar 21 '11 at 3:25
Yes, if you keep Ctrl+Shift held the whole time while typing the numbers, then it will appear immediately. If you release them before typing the numbers (which allows you to also use backspace) then a Space or Enter is required to show the end of the Unicode number input process. – sladen Mar 21 '11 at 3:29
Yowza, that's nice: type any Unicode character on codepoint. If only it had a character search capability. – Humphrey Bogart Mar 21 '11 at 12:51
Note that this only works for GTK applications. It won't it any Qt-based one, for example (thus the whole KDE and many individual apps like Skype). – Ruslan Sep 5 '14 at 6:31
Mmm... This does not work on Ubuntu 14.04 as Ctrl+Shift+U does not seem to work. Do I need to configure something in keyboard settings? I am testing it with gedit 3.10.4 and Ctrl+Shift+U then 2,0, 1, 4 and Enter displays 2014, and Ctrl+Shift+U+2014 displays )!$ – nephewtom Nov 8 '15 at 1:58

I could not find a way to type it using AltGr and default settings, but I found another way:

  1. Go to System -> Preferences -> Keyboard.

  2. Select the Layouts tab.

  3. Click Options.

  4. Under Compose Key Position (drop-down), choose a key to use for composing — I chose the Right Win (right Windows key).

  5. Now press and release the compose key, then type --- to get the em-dash.

[Here's a list of more characters you can type this way.]

UPDATE: As of Ubuntu 12.04

  1. Go to System Settings > Keyboard.

  2. Under Typing tab, select Layout Settings link (at the bottom of the dialog box).

  3. Click Options.

  4. Under Compose key position (drop-down), choose a key to use for composing — I chose the Right Win (right Windows key).

  5. Now press and release the compose key, then type --- to get the em-dash.

share|improve this answer
Note that there is no need to hold the compose key after it was pressed. – sam hocevar Mar 21 '11 at 7:19
Thanks Sam — all this time I've been holding the compose key unnecessarily! – Chris Billington Apr 4 '13 at 9:57
I find this method better than the selected answer. It is a lot of easier for both, remember it and typing it. – Fran May 8 '13 at 10:26
ubuntu 13.10: System Settings > Keyboard > Shortcuts > Typing > Compose Key – x-yuri Aug 4 '14 at 9:26
  1. Go to Applications->Accessories->Character Map.

    enter image description here

  2. Click Search->Find

    enter image description here

  3. Type 'em dash' and click 'Find Next'

    enter image description here

  4. Double click the symbol, which will put it in the 'Text to Copy' box at the bottom.

    enter image description here

  5. You can then copy-and-paste it where you want it.

    enter image description here

share|improve this answer
Or you could just bookmark this page and copy and paste it from the question :) – Alistair Buxton Mar 21 '11 at 0:32
Setting up compose keys is much easier than having to use the character map every time you want a special character. – J. Taylor Mar 21 '11 at 0:38
@jrt: It allows you to insert the character without altering your keyboard layout. Not everyone wants to change their layout just to type a dash. – Nathan Osman Mar 21 '11 at 0:42
lol @ comments! – MestreLion Mar 21 '11 at 4:44
I wasn't aware that the Character Map had a search option until reading this. Not sure if I'll ever use it, but +1 for enlightening us. (Please vote to delete the "answer" I left below... it was supposed to be a comment here.) – trench Aug 31 '11 at 22:39

I believe this is the best way to have some special chars, but I don't know if it works with all keyboards.

Im my Brazilian ABNT2 keyboard I can get it with the Compose key more tree hyphens. The compose key is mapped to my right Ctrl key, so:

  • Right Ctrl+--- (hold control while pressing all the hyphens) (—)

To get the en dash, use Ctrl + --. (hyphen, hyphen, dot)

  • Right Ctrl+--. (–)

A bonus one, for the … type:

  • Right Ctrl+.. (…)

You can configure your Compose key in: settings → keyboard → shortcuts → typing

share|improve this answer
By far the easiest way indeed. Thanks! – Ingo Sep 24 '13 at 12:32
This is the most human method, thanks! You can set the compose key in settings—keyboard—shortcuts—typing. Right control is OK, as it doesn't clash with other modifiers. – metakermit Feb 23 '14 at 16:16

The following keyboard layouts contain the em dash:

$ sgrep -o '%r\n' '"\"" _quote_ "\"" in ("name[Group1]" .. "\n" in outer("{" .. "}" containing "emdash"))' /usr/share/X11/xkb/symbols/??
Bulgaria - Traditional phonetic
Switzerland - German (Macintosh)
Germany - Neo 2
France - Bepo, ergonomic, Dvorak way
France - Macintosh
Iceland - Macintosh
Iceland - Dvorak
Norway - Northern Saami
USA - Macintosh
USA - Colemak

Personally, I use Colemak, in which the em dash is AltGr+Shift+-.

share|improve this answer

I prefer remapping one of my lesser-used keys to an em-dash so that I don't have to type a crazy combination of keys in order to get it.

  1. Identify a key you don't mind remapping. My laptop has a second backslash key, so I used that.
  2. Find the keycode for that key using xev. Run xev from a terminal, and press the key, paying attention to the keycode that pops up. When I press my key, for instance, I get state 0x0, keycode 94 (keysym 0x3c, less), same_screen YES,, so I know my keycode is 94.
  3. Assign the emdash to that keycode using xmodmap. I run xmodmap -e "keycode 94 = emdash ellipsis" because I also want to assign Shift+backspace to the ellipsis character.
  4. Figure out a way to get xmodmap to run on startup. This is the part I'm unsure about. I think it involves editing ~/.Xmodmap, but there's some debate about this, apparently.
share|improve this answer

Ubuntu 14.04, 15.04, & 15.10

Note: this method has been referenced previously but it has changed in 14.04 and the link to the compose key character reference is now broken.

The settings dialog to set the compose key has moved in 14.04.

  1. Go to System Settings->Keyboard
  2. Click the Shortcuts tab
  3. Select Typing in the left pane
  4. Set the Compose Key to your desired setting

Now all you have to do to is press and release the Compose Key and then type your sequence (e.g. --- for emdash) and it will be converted. :)

New link for compose key character reference

share|improve this answer

To get xmodmap to run on startup in Ubuntu 12.10, Go to Dash Home. Type in Startup. Click on Startup Applications. Click Add. In the "add startup program" window, give it a name. In the command box, enter: xmodmap -e "keycode 94 = emdash ellipsis"

Then, click on Add. You'll see the program name you just gave this under startup applications. Close the windows. The command will run the next time you start the computer. (I just spent a week and many hours reading these posts here and finally figured it out on my own.) This might not be the best way to do this, but it works.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.