I have consistently struggled to remember which keyboard key is the forward slash and which is the backslash. This week, I decided it was time to figure out a way to remember which is which, and this is the story of my journey. If you also have trouble with slashes, you won’t want to miss this one.

Naming inconsistency

The first thing I noticed was the naming inconsistency. The keyboard keys are called the forward slash and backslash, not forward slash and backward slash. Hmmm. Why is this? It is something I will come back to later.

Naming origins

Next, as forward and back(ward) are directions, I thought these keys must be named for the direction their diagonals point in.

In western languages we read from left to right. Logically, this must mean that a forward slash diagonal points forward, which is to the right, as shown in the following diagram.

Image of slash key direction

It does point forward. It also points up.

Therefore, logically this means the backslash must point backward (left).

Image of backslash key direction

However, from the diagram we see it doesn’t point backward at all. Reading from the left, the backslash diagonal also points forward. Opposite to the slash, though, the backslash points down. In thinking about this more carefully, the reading direction is always forward so it is impossible for the backslash diagonal to point against the reading direction.

Logically, we should really call these keys the upslash and downslash. This would also make it easier to remember them.

upslash downslash

But, since when was the English language logical?

Positional mnemonic

After failing in my first attempt to remember which key is which by applying naming logic, I next looked at how these keys are positioned on the keyboard. I wondered if I could find a positional mnemonic that would help. Sure enough, the Backslash key lies directly underneath the BACKSPACE key as you can see in the following photo.

keyboard backslash

By elimination, this makes the diagonal key on the bottom row next to the SHIFT key the forward slash key.

keyboard slash

Therefore, if I need to type a filepath that someone is reading aloud, when she says "backslash" I know to press the key under the BACKSPACE key. As my keyboard has the word BACKSPACE printed on the key, it is easy for me to know which key to press. If my colleague says "forward slash" I know to press the diagonal key that is NOT under the BACKSPACE key.

Just be aware that instead of the word BACKSPACE, some keyboards use an arrow, the word delete, or something else. If you have one of those keyboards, you’re going to have to make that mental translation. Incidentally, the word delete makes more sense because when you press the key it deletes the character behind the cursor. The word backspace probably originates from the typewriter key in the same location that moves back one character but doesn’t delete the letter ink typed on the paper.

So far so good. But what if I’m in a coffee shop reading a book about regular expressions and have no computer keyboard to refer to? Here is a regular expression from a book that I have probably taken to a coffee shop at some time.

http:\/\/[\w.\/]+

How do I know the right way to say these slashes? It was time to dig deeper. I thought, maybe if I understand the origins of these diagonal marks there will be a clue that will help me remember which is which.

The slash key

I have a giant desktop typewriter that was made in 1956. It has a forward slash key at the end of the bottom row below the question mark. However, it has no backslash key.

typewriter slash

The forward slash key has been used on typewriters since the 1800’s , although it isn’t always on the bottom row. The forward diagonal punctuation mark has an even longer history [1]. It has been in general use since medieval times when, among other things, it was used to separate lines in the following manner.

The woods are lovely, dark, and deep, / But I have promises to keep, / And miles to go before I sleep"
— Robert Frost

This forward diagonal punctuation mark has numerous other historical names, such as virgule, stroke, oblique, and solidus. However, since the early 60’s it has generally been known as just the slash.

So, that’s the slash. What about the history of the backslash?

The backslash key

As someone who owns five vintage typewriters, I can assure you they have no backslash key. However, I did wonder if modern typewriters have it? There is a company called Nakajima [2] that still makes (electronic) typewriters. Photos of their products show that modern typewriters have no backslash key either.

So when did the backslash key first appear? The character we now know as the backslash first appeared on teletype (teleprinter) machines in the 1930’s [3] although it is not known what it was used for. The following photo shows the slash key on the far right of the front row and the backslash character above it.

teletype wheatstone perforator keyboard
Photo by Tadfafty distributed under a CC BY-SA 4.0

Much later, in the 1960’s, IBM needed an extra character to represent new programming elements and they re-used the teletype character for it. They gave it the name 'backslash' because the direction of the diagonal is opposite from that of the slash. The backslash character is the mirror image of the slash character.

Interim summary

To summarize so far, the slash character has been used for centuries and is the only diagonal key used on typewriters. The backslash character is specific to computer keyboards and the subject of computing, and is the mirror image of the slash character.

Slash key naming ambiguity

With the addition of the backslash key to the computer keyboard, a little ambiguity was introduced.

If we say, "slash" do we really mean just slash or might we possibly mean backslash? To eliminate the ambiguity it has become common for people to say "forward slash" instead of "slash". I’ve definitely been in the forward slash camp, but now that I understand the historical context I plan to defect.

The way the name forward slash grew up explains the naming inconsistency noted at the beginning of this article. The name backslash was used to distinguish the new key needed for computing from the general-purpose slash key. To make it clear that a slash really is a slash, we could use any antonym of back, such as hind, fore, or rear, but Hindslash, foreslash, and rearslash don’t sound that great. I guess, the term forward slash stuck as the best option.

North Star mnemonic

Now, let’s return to the book-in-a-coffee-shop problem. If I am reading a book and come across a "/" character, how do I know whether to say slash or backslash? The first clue is in the subject matter of the book. If the book has nothing to do with computing, the diagonal character is almost certainly the plain ol' general-purpose slash you and I have been using for years to write fractions such as 1/2 and 1/4 and dates such as 2022/02/20. People were typing fractions and dates on typewriters long before computers existed, and that is what the diagonal key at the bottom of the typewriter keyboard is for.

But what if, like my regular expressions book, the subject matter is about computing and has both types of slash? Remember this?

http:\/\/[\w.\/]+

Knowing that the diagonal character in fractions is the vintage, original general-purpose slash should be all we need to translate the symbols into words. But, just to be thorough, I still wanted to find a mnemonic that I could picture in my mind because visuals always help.

Here’s what I came up with.

north star

In this mnemonic, the ENTER (RETURN) key is our North Star, the guiding point in the sky (at least for those of us in the Northern Hemisphere). Everything points to the North Star. In the standard western reading direction, from left to right, the bottom-row slash diagonal points up to the "North Star". The backslash diagonal near the top points down to the "North Star". The slash points up and the backslash points down.

Tennis mnemonic

And here’s one more visual. Outstretch your right arm to make a vintage, general-purpose slash, or forward slash. If you were playing tennis, this is roughly how you would position your arm for a high forehand return.

arm slash

Now, pivot your arm at the shoulder back the other way to the left to make a backslash. In tennis, this is how you would roughly position your arm for a high backhand return.

When to use the slash and backslash

Now that you’ve learned how to distinguish the slash key from the backslash key on the keyboard, the history of these keys, and a few ways to remember which character diagonal goes which way, let’s review when to use these keys.

When to use the slash

Use the slash in everyday contexts such as:

  • Dates (2022/02/20)

  • Fractions (1/4)

  • To separate choices (yes/no)

  • For page numbers and total page counts (17/64)

  • For two-letter initialisms (A/C, b/w)

  • For abbreviations (/w, b/c)

Use the slash in computing for:

  • UNIX and MacOS local and network filepath directory separators (/home/mark/Pictures/photo.jpg)

  • Internet URLs (http://www.tek-write.com)

  • Commandline switches (dir /A /F > dir.txt)

  • HTML and XML closing tags (<p>This is a paragraph.</p>)

When to use the backslash

Use the backslash in computing for:

  • Windows local and network filepath directory separators (C:\Users\mark\Documents\notes\a-note.txt)

  • Special character escapes used in text editing (for example in regular expressions \n means newline and \t means tab)