Underscore

Updated: 05/01/2023 by Computer Hope
Underscore before and after a word.

Alternatively known as a low line, low dash, and understrike, the underscore ( _ ) is a symbol found on the same keyboard key as the hyphen. The picture shows an underscore at the beginning and end of the word "Underscore."

Where is the underscore key on the keyboard?

Below is an overview of a computer keyboard with the underscore key highlighted in blue.

Underscore key

How to create the "_" symbol

Creating the "_" symbol on a U.S. keyboard

To create the underscore using a U.S. keyboard, hold down Shift and press - (hyphen) key.

Tip

Doing the Alt code Alt+95 can also create an underscore.

Creating the "_" symbol on a smartphone or tablet

To create an underscore on a smartphone (Apple iPhone or Android) or tablet (iPad), open the keyboard, access the numbers (123) keys, then access the (#+=) or symbols (sym) section. Press your finger on the "_" key.

What is an underscore used for on a computer?

Programming

The underscore is commonly used as an alternative to the space key when a space is not allowed. For example, a variable may be named $my_variable in computer programming because spaces are not permitted in a variable name.

Keyboard shortcut

The underscore key is used in keyboard shortcuts like Ctrl+Shift+_.

Underscore vs. underline

Underlined word

An underscore is different than an underline. If you are trying to underline any letter, number, or other text, the underline feature should be used. The underscore, by contrast, takes the place of another character, like a number, letter, or symbol; it cannot be used under another character.

Note

Some programs (e.g., Discord) may use the underscore to help create underlined text. For example, in Discord typing two underscores before and after text ( __example__) creates underlined text (example).

Underscore in file names

It is not uncommon to use an underscore in a file name in place of a space, especially on the Internet. However, if you're concerned about SEO (search engine optimization), we suggest using a hyphen instead of an underscore when separating keywords. Google treats an underscore as a combiner and a hyphen as a separator. So "computer_hope" is treated as "computerhope," and "computer-hope" is treated as "computer hope."

Underscore in an e-mail address

With most e-mail addresses, one or more underscores can be used in an e-mail address to make it easier to read a username. For example, "[email protected]" is harder to read than "[email protected]." However, not all e-mail services allow underscores (e.g., Gmail doesn't allow underscores).

Should I use underscores in my e-mail?

For services that do support underscores in an e-mail address, consider the cons of using an underscore. Many people find having underscores in an e-mail address or username annoying because it's difficult to type. If you use two or more underscores next to each other, it's difficult to read. Also, not everyone knows how to type an underscore and may not enter the correct e-mail address.

We recommend avoiding underscores when creating an e-mail address. It may be easier to read, but it can be difficult to type and make it difficult to share.

What is the other symbol on the underscore key?

On U.S. keyboards, the underscore key is shared with the hyphen key, which may be next to or above the hyphen symbol. To create the underscore, hold down Shift while pressing - (above P keyboard key).

Is the underscore punctuation?

The underscore is a character and not punctuation. When the underscore was introduced on a typewriter, it was used to underline typed text.

CamelCase, Keyboard terms, Typography terms, White space