Skip to content
typometer
Menu

How to type every programming symbol

On a US keyboard, 12 of the 16 symbols covered here need Shift, and 8 are typed by a little finger. The table below gives the keys, the finger, and the Windows Alt and Unicode codes for each one. Each name links to a full guide with what the symbol means and the mistake people make with it.

Find or copy a symbol

All 16 symbols on a US keyboard

SymbolKeysFingerWindows Alt codeUnicode
@At signShift + 2Left ringAlt + 64U+0040
&AmpersandShift + 7Right indexAlt + 38U+0026
#HashShift + 3Left middleAlt + 35U+0023
*AsteriskShift + 8Right middleAlt + 42U+002A
\Backslash\ keyRight pinkyAlt + 92U+005C
_UnderscoreShift + -Right pinkyAlt + 95U+005F
~TildeShift + `Left pinkyAlt + 126U+007E
^CaretShift + 6Right indexAlt + 94U+005E
|PipeShift + \Right pinkyAlt + 124U+007C
%Percent signShift + 5Left indexAlt + 37U+0025
{ }Curly bracketsShift + [Right pinkyAlt + 123U+007B
< >Angle bracketsShift + ,Right middleAlt + 60U+003C
$Dollar signShift + 4Left indexAlt + 36U+0024
`Backtick` keyLeft pinkyAlt + 96U+0060
/Forward slash/ keyRight pinkyAlt + 47U+002F
[ ]Square brackets[ keyRight pinkyAlt + 91U+005B

When a symbol needs Shift, hold it with the little finger of the opposite hand. Keys and fingers are read from the same layout the typing course teaches, so this table and the lessons always agree.

Brackets and pairs

Code nests, and every opener needs its closer: function bodies, lists, generics and HTML tags. Editors usually type the closing half for you, which is why people slow down when they have to type it themselves.

Paths and the terminal

The forward slash separates folders on Mac, Linux and the web; the backslash does on Windows. In a Unix shell the tilde is your home folder and the pipe sends one command's output into the next. In Markdown, backticks wrap inline code.

Operators

Multiplication, remainder, bitwise AND and exclusive-or in most programming languages. The caret is the one to watch: it means a power in a spreadsheet and exclusive-or in a program.

Names, comments and variables

The underscore joins words in snake_case names. The at sign marks decorators and email addresses. The hash starts a comment in Python, shell scripts and many configuration files, and the dollar sign marks a variable in shell and PHP.

Where the symbols move on other keyboards

Programming syntax was shaped on US keyboards, which is why typing it is harder almost everywhere else. On the European layouts below, braces and square brackets are not on the Shift layer at all: they sit on the AltGr layer, the right Alt key held with another key.

SymbolFrench (AZERTY)German (QWERTZ)Spanish (QWERTY)Portuguese (Portugal)
@AltGr layerAltGr layerAltGr layerAltGr layer
&& keyShift + 6Shift + 6Shift + 6
#AltGr layer# keyAltGr layerShift + 3
** keyShift + +Shift + +Shift + +
\AltGr layerAltGr layerAltGr layer\ key
__ keyShift + -Shift + -Shift + -
~AltGr layerAltGr layerAltGr layer~ key
^^ key^ keyShift + `Shift + ~
|AltGr layerAltGr layerAltGr layerShift + \
%Shift + ÙShift + 5Shift + 5Shift + 5
{ }AltGr layerAltGr layerAltGr layerAltGr layer
< >< key< key< key< key
$$ keyShift + 4Shift + 4Shift + 4
`AltGr layerShift + ´` keyShift + ´
/Shift + :Shift + 7Shift + 7Shift + 7
[ ]AltGr layerAltGr layerAltGr layerAltGr layer

A key is named by what is printed on its unshifted face. On these layouts the caret, backtick and tilde are usually dead keys: press the key, then Space, to get the symbol on its own.

Practise them in real code

Knowing where a key is does not make it fast. Symbols slow you down in the transition between characters: a closing bracket after a quote, or a colon after a parenthesis. Code typing practice drills them in short, real snippets in 6 languages, and Code Breaker does the same under time pressure.

Questions about typing symbols

Are the symbol keys in the same place on Mac and Windows?

On a US layout, yes: every symbol on this page is on the same key, with the same Shift, on Windows, Mac and Linux. What moves symbols is the keyboard layout, not the operating system. Mac has no Alt codes; use the Character Viewer (Control + Command + Space) for a symbol your keyboard lacks.

Why are programming symbols so slow to type?

Because of where they are. 12 of these 16 symbols need Shift, and 8 of them are typed by a little finger, the weakest on the hand. The right little finger alone owns 6. Ordinary prose almost never uses them, so they never become automatic by accident.

How do I type a symbol when my keyboard does not have the key?

On Windows, hold Alt and type the code from the table on the numeric keypad, with Num Lock on. On a Mac, use the Character Viewer. On many Linux desktops, press Control + Shift + U, type the Unicode hex code from the table, then press Space or Enter.