The backtick is a typographical mark used mainly in
computing
Computing is any goal-oriented activity requiring, benefiting from, or creating computer, computing machinery. It includes the study and experimentation of algorithmic processes, and the development of both computer hardware, hardware and softw ...
. It is also known as backquote, grave, or
grave accent
The grave accent () ( or ) is a diacritical mark used to varying degrees in French, Dutch, Portuguese, Italian, Catalan and many other Western European languages as well as for a few unusual uses in English. It is also used in other ...
.
The character was designed for typewriters to add a grave accent to a (lower-case) base letter, by overtyping it atop that letter. On early computer systems, however, this physical
dead key
A dead key is a special kind of modifier key on a mechanical typewriter, or computer keyboard, that is typically used to attach a specific diacritic to a base letter (alphabet), letter. The dead key does not generate a (complete) grapheme, charact ...
+overtype function was rarely supported, being functionally replaced by
precomposed character
A precomposed character (alternatively composite character or decomposable character) is a Unicode entity that can also be defined as a sequence of one or more other characters. A precomposed character may typically represent a letter with a diac ...
s. Consequently, this ASCII symbol was rarely (if ever) used in computer systems for its original aim and became repurposed for many unrelated uses in computer programming.
The sign is located on the left-top of a US or UK layout keyboard, next to the key. Provision (if any) of the backtick on other keyboards varies by national
keyboard layout
A keyboard layout is any specific physical, visual, or functional arrangement of the keys, legends, or key-meaning associations (respectively) of a computer keyboard, mobile phone, or other computer-controlled typographic keyboard. Standard keybo ...
and
keyboard mapping
A keyboard layout is any specific physical, visual, or functional arrangement of the keys, legends, or key-meaning associations (respectively) of a computer keyboard, mobile phone, or other computer-controlled typographic keyboard. Standard keybo ...
.
History
Typewriters
On typewriters designed for languages that routinely use
diacritic
A diacritic (also diacritical mark, diacritical point, diacritical sign, or accent) is a glyph added to a letter or to a basic glyph. The term derives from the Ancient Greek (, "distinguishing"), from (, "to distinguish"). The word ''diacrit ...
s (accent marks), there are two possible solutions. Keys can be dedicated to pre-composed characters or alternatively a
dead key
A dead key is a special kind of modifier key on a mechanical typewriter, or computer keyboard, that is typically used to attach a specific diacritic to a base letter (alphabet), letter. The dead key does not generate a (complete) grapheme, charact ...
mechanism can be provided. With the latter, a mark is made when a dead key is typed but, unlike normal keys, the paper carriage does not move on and thus, the next letter to be typed is printed under the accent.
Incorporation into ISO 646 and ASCII
The incorporation of the grave symbol into ASCII is a consequence of this prior existence on typewriters. This symbol did not exist independently as a
type
Type may refer to:
Science and technology Computing
* Typing, producing text via a keyboard, typewriter, etc.
* Data type, collection of values used for computations.
* File type
* TYPE (DOS command), a command to display contents of a file.
* ...
or
hot-lead printing character.
Thus, ISO646 was born and the ASCII standard updated to include the backtick and other symbols.
As surrogate of apostrophe or (opening) single quote
Some early ASCII peripherals designed the backtick and apostrophe to be mirror images of each other: and . This allowed them to be used as matching pairs of open and close quotes while still being somewhat usable as grave and acute accents, made apostrophes typographically correct, and allowed the apostrophe to be used as a prime. This had a number of problems that led most modern systems and Unicode to render the apostrophe as a "straight" one:
* Open quote is not typographically correct: the correct form () is flipped vertically from what is shown here.
* No matching double quotes, although two single quotes looked acceptable on proportionally-spaced devices.
* Wrong appearance if used as overprinted diacritics.
* Lots of software and documents used the apostrophe for opening as well as for closing quotes.
This can still be seen in documents and email from that time (before 1990), and in output generated by some UNIX console programs such as
man pages
A man page (short for manual page) is a form of software documentation found on Unix and Unix-like operating systems. Topics covered include programs, system libraries, system calls, and sometimes local system details. The local host administ ...
. Institutions that traditionally had used it have abandoned or deprecated it.
Computing
Command-line interface languages
Many
command-line interface languages and the
scripting (programming) languages like
Perl
Perl is a high-level, general-purpose, interpreted, dynamic programming language. Though Perl is not officially an acronym, there are various backronyms in use, including "Practical Extraction and Reporting Language".
Perl was developed ...
,
PHP
PHP is a general-purpose scripting language geared towards web development. It was originally created by Danish-Canadian programmer Rasmus Lerdorf in 1993 and released in 1995. The PHP reference implementation is now produced by the PHP Group. ...
,
Ruby
Ruby is a pinkish-red-to-blood-red-colored gemstone, a variety of the mineral corundum ( aluminium oxide). Ruby is one of the most popular traditional jewelry gems and is very durable. Other varieties of gem-quality corundum are called sapph ...
and
Julia
Julia may refer to:
People
*Julia (given name), including a list of people with the name
*Julia (surname), including a list of people with the name
*Julia gens, a patrician family of Ancient Rome
*Julia (clairvoyant) (fl. 1689), lady's maid of Qu ...
(though see below) use pairs of backticks to indicate
command substitution
In computing, command substitution is a facility that allows a Command-line interpreter, command to be run and its output to be pasted back on the command line as arguments to another command. Command substitution first appeared in the Bourne she ...
. A command substitution is the
standard output Standard may refer to:
Symbols
* Colours, standards and guidons, kinds of military signs
* Standard (emblem), a type of a large symbol or emblem used for identification
Norms, conventions or requirements
* Standard (metrology), an object t ...
from one command, into an embedded line of text within another command. For example, using $ as the symbol representing a terminal prompt, the code line:
:
In all POSIX
shell
Shell may refer to:
Architecture and design
* Shell (structure), a thin structure
** Concrete shell, a thin shell of concrete, usually with no interior columns or exterior buttresses
Science Biology
* Seashell, a hard outer layer of a marine ani ...
s (including
Bash and
Zsh
The Z shell (Zsh) is a Unix shell that can be used as an interactive login shell and as a command interpreter for shell scripting. Zsh is an extended Bourne shell with many improvements, including some features of Bash, ksh, and tcsh.
Zsh was ...
), the use of backticks for command substitution is now largely deprecated in favor of the notation
$(...)
, so that the example above would be re-written:
:
The new syntax allows nesting, for example:
:
Markup languages
It is sometimes used in
source code comments
In computer programming, a comment is text embedded in source code that a translator (compiler or interpreter) ignores. Generally, a comment is an annotation intended to make the code easier for a programmer to understand often explaining an a ...
to indicate code, e.g.,
:
/* Use the `printf()` function. */
This is also the format the
Markdown
Markdown is a lightweight markup language for creating formatted text using a plain-text editor. John Gruber created Markdown in 2004 as an easy-to-read markup language. Markdown is widely used for blogging and instant messaging, and also used ...
formatter uses to indicate code. Some variations of Markdown support "fenced code blocks" that span multiple lines of code, starting (and ending) with three backticks in a row (
```
).
*
TeX
Tex, TeX, TEX, may refer to:
People and fictional characters
* Tex (nickname), a list of people and fictional characters with the nickname
* Tex Earnhardt (1930–2020), U.S. businessman
* Joe Tex (1933–1982), stage name of American soul singer ...
: The backtick character represents curly opening quotes. For example,
`
is rendered as single opening curly quote () and
``
is a double curly opening quote (). It also supplies the numeric ASCII value of an ASCII character wherever a number is expected.
Programming languages
*
BBC BASIC
BBC BASIC is an interpreted version of the BASIC programming language. It was developed by Acorn Computers Ltd when they were selected by the BBC to supply the computer for their BBC Literacy Project in 1981.
It was originally supplied on ...
: The backtick character is valid at the beginning of or within a variable, structure, procedure or function name.
*
D and
Go: The backtick surrounds a
raw string literal.
*
F#: Surrounding an identifier with double backticks allows the use of identifiers that would not otherwise be allowed, such as keywords, or identifiers containing punctuation or spaces.
*
Haskell
Haskell () is a general-purpose, statically typed, purely functional programming language with type inference and lazy evaluation. Designed for teaching, research, and industrial applications, Haskell pioneered several programming language ...
: Surrounding a function name by backticks makes it an
infix operator
Infix notation is the notation commonly used in arithmetical and logical formulae and statements. It is characterized by the placement of operators between operands—"infixed operators"—such as the plus sign in .
Usage
Binary relations are o ...
.
*
JavaScript
JavaScript (), often abbreviated as JS, is a programming language and core technology of the World Wide Web, alongside HTML and CSS. Ninety-nine percent of websites use JavaScript on the client side for webpage behavior.
Web browsers have ...
:
ECMAScript 6
ECMAScript is a JavaScript standard developed by Ecma International. Since 2015, major versions have been published every June.
ECMAScript 2024, the 15th and current version, was released in June 2024.
Versions
In June 2004, Ecma International ...
standard introduced a "backtick" character which indicated a string or
template literal. Its applications include (but are not limited to): string interpolation (substitution), embedded expressions, and multi-line strings. In the following example
name
and
pet
variable's values get substituted into the string enclosed by grave accent characters:
::
const name = "Mary", pet = "lamb"; // Set variables
let temp = `$ has a little $!`;
console.log(temp);
// => "Mary has a little lamb!";
*
Lisp
Lisp (historically LISP, an abbreviation of "list processing") is a family of programming languages with a long history and a distinctive, fully parenthesized Polish notation#Explanation, prefix notation.
Originally specified in the late 1950s, ...
macro systems: The backtick character (called ''quasiquote'' in
Scheme
Scheme or schemer may refer to:
Arts and entertainment
* ''The Scheme'', a BBC Scotland documentary TV series
* The Scheme (band), an English pop band
* ''The Scheme'', an action role-playing video game for the PC-8801, made by Quest Corporation
* ...
) introduces a quoted expression in which comma-substitution may occur. It is identical to the plain quote, except that a nested expression prefixed with a
comma
The comma is a punctuation mark that appears in several variants in different languages. Some typefaces render it as a small line, slightly curved or straight, but inclined from the vertical; others give it the appearance of a miniature fille ...
is replaced with the value of that nested expression. If the nested expression happens to be a symbol (that is, a variable name in Lisp), the symbols' value is used. If the expression happens to be program code, the first value returned by that code is inserted at the respective location instead of the comma-prefixed code. This is roughly analogous to the Bourne shell's
variable interpolation
Variable may refer to:
Computer science
* Variable (computer science), a symbolic name associated with a value and whose associated value may be changed
Mathematics
* Variable (mathematics), a symbol that represents a quantity in a mathemat ...
with
$
inside double quotes.
*
Julia
Julia may refer to:
People
*Julia (given name), including a list of people with the name
*Julia (surname), including a list of people with the name
*Julia gens, a patrician family of Ancient Rome
*Julia (clairvoyant) (fl. 1689), lady's maid of Qu ...
: Backticks make a command object,
Cmd
, that can be run, with run function, like
run(`echo Hello world!`)
. You can interpolate Julia variables, but only indirectly shell environment variables.
*
m4: A backtick together with an apostrophe quotes strings (to suppress or defer macro expansion).
*
MySQL
MySQL () is an Open-source software, open-source relational database management system (RDBMS). Its name is a combination of "My", the name of co-founder Michael Widenius's daughter My, and "SQL", the acronym for Structured Query Language. A rel ...
/
MariaDB
MariaDB is a community-developed, commercially supported Fork (software development), fork of the MySQL relational database management system (RDBMS), intended to remain free and open-source software under the GNU General Public License. Developm ...
: A backtick in queries is a delimiter for column, table, and database identifiers.
*
OCaml
OCaml ( , formerly Objective Caml) is a General-purpose programming language, general-purpose, High-level programming language, high-level, Comparison of multi-paradigm programming languages, multi-paradigm programming language which extends the ...
: The backtick indicates polymorphic variants.
*
Pico
Pico may refer to:
Places The Moon
* Mons Pico, a lunar mountain in the northern part of the Mare Imbrium basin
Portugal
* Pico, a civil parish in the municipality of Vila Verde
* Pico da Pedra, a civil parish in the municipality of Ribe ...
: The backtick indicates comments in the programming language.
*
PowerShell
PowerShell is a shell program developed by Microsoft for task automation and configuration management. As is typical for a shell, it provides a command-line interpreter for interactive use and a script interpreter for automation via a langu ...
: The backtick is used as the escape character. For example, a newline character is denoted
`n
. Most common programming languages use a backslash as the escape character (e.g.,
\n
), but because Windows allows the backslash as a path separator, it is impractical for PowerShell to use backslash for a different purpose. Two backticks produce the
`
character itself. For example, the
nullable boolean
Any kind of logic, function, expression, or theory based on the work of George Boole is considered Boolean.
Related to this, "Boolean" may refer to:
* Boolean data type, a form of data with only two possible values (usually "true" and "false" ...
of
.NET
The .NET platform (pronounced as "''dot net"'') is a free and open-source, managed code, managed computer software framework for Microsoft Windows, Windows, Linux, and macOS operating systems. The project is mainly developed by Microsoft emplo ...
is specified in PowerShell as
ullable``1[System.Boolean
.
* Python (programming language)">Python
Python may refer to:
Snakes
* Pythonidae, a family of nonvenomous snakes found in Africa, Asia, and Australia
** ''Python'' (genus), a genus of Pythonidae found in Africa and Asia
* Python (mythology), a mythical serpent
Computing
* Python (prog ...
function, which converts its argument to a string suitable for a programmer to view. However, this feature was removed in Python 3.0. Backticks also appear extensively in the reStructuredText plain text markup language (implemented in the Python docutils package).
* R (programming language), R: The backtick is used to surround non-syntactic variable names. This includes variable names containing special characters or
, among others.
: An identifier may also be formed by an arbitrary string between backticks. The identifier then is composed of all characters excluding the backticks themselves.
*
: The backtick is used at the beginning of compiler's directives.
. This is true for games such as ''
.
While not necessarily the original progenitor of the console key concept, ''Quake'' is still widely associated with any usage of the key as a toggle for a drop-down console, often being referred to as the "Quake Key". In 2021,
introduced a "Quake Mode" which enables a global shortcut of + that opens a terminal window pinned to the top half of the screen.