February 24th 2005 Slash vs. Backslash

It always amazes me how people can fail to understand the difference between a slash and a backslash, but they do, so I’m going to post a short article on how to tell the difference. At the very least, all Monkey Robot readers will know how to tell the difference.

It’s pretty simple to tell the difference between a slash (also known as a forward slash) and a backslash. A slash looks like this: /. It’s also known as a virgule or a solidus. It’s easy to tell it’s a forward slash because it leans forward. The slash has numerous uses, including

  • acting as a path delimiter in Internet addresses and UNIX path names (www.facstaff.bucknell.edu/mdippery, /usr/bin/);
  • indicating a combination or choice between objects (he was a florist/delivery boy);
  • indicating line endings in poetry when written as prose (“Roses are red / Violets are blue”).

A backslash, on the other hand, looks like this: \. It’s easy to remember because it leans backwards, hence the name. Backslashes are mainly used in computing and have a more limited use than the slash:

  • acting as a path delimiter in Windows path names (C:\Program Files\Adobe Photoshop);
  • escaping characters in most C-style languages, including C, C++, PHP, Perl, and also on most UNIX shells (<?php echo "This is in \"quotes\""; ?>).

Now that you know the difference, you need to know where the key lies on your keyboard. If someone says to type a “slash,” they mean to use this character: /. The / character is directly to the left of the right shift key and is marked with a /.

If someone instructs you to type a “backslash,” they want you to type this character: \. The \ key is directly above the Enter key (Return key on a Macintosh keyboard) and is marked with a \. (It is also marked with a |, also known as a pipe character, but that’s a pretty UNIX-y character that we won’t deal with in this article.)

Go ahead and test out those keys on your own. Practicing using them in case the situation arises sometime in the future!

(This has been a public service announcement from Monkey Robot.)