The backslash is the typographic character represented by the glyph \ and known by alternative names such as reverse slash or backslant. It is distinct from the forward slash (/), and its primary role today is technical rather than punctuational. While rare in ordinary prose, the symbol appears pervasively in programming, command shells, markup systems and file system conventions.
Appearance and encoding
In modern character sets the backslash occupies a defined code position: it is part of ASCII and Unicode (commonly cited as U+005C) and corresponds to decimal code 92 in the ASCII table. Because the glyph looks similar to other diagonal marks, fonts and locales sometimes render it in slightly different shapes, which can affect legibility in monospace displays.
History and rationale
The backslash was added to early computing character sets in the mid-20th century to provide a symbol not widely used in ordinary text. Designers preferred a mirror image of the forward slash so computing systems could reserve the forward slash for existing uses (such as options in command lines or punctuation) and use the backslash for machine-oriented tasks without colliding with conventional writing.
Common uses and examples
- String and character escapes in many programming languages: \n for newline, \t for tab, etc.
- File system paths on Windows and DOS: for example, C:\Windows\System32 (users often must escape backslashes in code).
- Network share notation (UNC): leading double backslashes such as \\server\share.
- Line continuation in shells and scripts: a trailing \ can join split lines.
- Control sequences in typesetting systems like TeX where commands begin with \ (for example, \alpha).
- Escaping special characters in regular expressions (e.g., \.) and other syntaxes.
Notable quirks and distinctions
Because the backslash was chosen for technical use rather than typography, it has produced interoperability issues: URLs and web standards use the forward slash, so backslashes are not valid separators in web addresses; some legacy code pages render the same code point as a local currency symbol (notably the Yen sign), creating confusing displays on systems configured for those locales. Developers also encounter the need to double or escape backslashes when embedding paths or literal sequences in source code.