Alternatively referred to as a solidus, virgule, or whack, the forward slash is the name of the "/" character on the computer keyboard. Forward slashes most commonly used to describe a network address, URL's, and other addresses. For example, in the below Computer Hope URL, the forward slash is used three times.
Although "slash" is most often used to describe the forward slash, it can also describe a backward slash. It's better to say "forward slash" instead of "slash" when telling someone to enter a forward slash.
Where is the forward slash key on the keyboard?
Below is an overview of a computer keyboard with the forward slash key highlighted in blue on the main keyboard as well as the numeric keypad.
How to create a forward slash
Creating the "/" symbol on a U.S. keyboard
Creating the "/" symbol on a smartphone or tablet
Other uses of the forward slash
A forward slash may also be used for any of the following reasons.
In a math formula, a forward slash is used to represent a division (divide). For example, in the below formula you can see that 10 <divided by> 2 is equal to 5.
10 / 2 = 5
Separate the month, day, and year of a date
Forward slashes are used in many parts of the world to separate the month, day, and year of a date. For example, in the United States, 5/14/2019 is May 14, 2019.
Different parts of the world have different date formats. For example, instead of the above format of M/dd/yy, it may be formatted as yy/MM/dd or dd-MMM-yy.
Nonexecutable statement in computer programming
Another example of a forward slash is in the nonexecutable statement used with some programming languages. For example, in the following PHP code, the comment "hidden text" would not show when executed because it is surrounded by a forward slash and an asterisk.
<?php /* hidden text */ echo "hello world"; ?>
Closing tags in HTML and XML
With HTML, XML, and other markup languages, the forward slash is used with closing tags to let the browser or reader know when a tag ends. Below is an example of a bold HTML tag with a beginning and end tag surrounding "bold text" and making it bold.
Example of <b>bold text</b>.
Command line switch or another program option
In MS-DOS and the Windows command line, the forward slash is used to perform a command option or switch. For example, with the below dir command, the /p performs the directory listing one page at a time.
In online games, the forward slash starts an action. For example, in World of Warcraft, typing /dance into chat makes your character dance.
A forward slash in a spreadsheet program
When not used in a formula a forward slash with only numbers is treated as a date. For example, if you entered "2/1" in a cell, Excel treats the cell as the date "1-Feb" or "2/1/2019."
Regular expression delimiter
With a regular expression, a forward slash is used as a delimiter or separator. For example, in the following Perl regular expression, all of the letter "a" characters are replaced with the letter "b" in the $example variable.
$example =~ s/a/b/g;