Backtick

Definition

A backtick is the ` character, formally the grave accent (Unicode U+0060). It is also called a backquote or, loosely, a reverse apostrophe. On most English keyboard layouts it shares the key immediately left of the number 1 with the tilde (~). In programming it is punctuation with real meaning: it delimits inline code in Markdown, template literals in JavaScript, identifiers in MySQL, and command substitution in Unix shells.

Key Takeaways

  1. A backtick (`) slants the opposite way to an apostrophe ('). They are different characters and are not interchangeable in code.
  2. Its meaning depends entirely on context: Markdown treats it as a code delimiter, JavaScript as a string delimiter, MySQL as an identifier quote, and shells as command substitution.
  3. On a US or UK keyboard it is the unshifted character on the key left of 1, below Esc. On some layouts it is a dead key that waits for a vowel to produce an accented letter such as à or è.

Explanation

The grave accent began as a typographic mark for indicating stress or pitch in languages such as French and Italian, where it still appears in letters like à and è. When it was carried into early character encodings it became available as a standalone symbol, and because it was rarely needed for prose in English it was free for programming languages to assign a special meaning to.

In Markdown, a single backtick on each side of a phrase renders it as inline code, and three backticks on their own lines open and close a fenced code block, optionally followed by a language name for syntax highlighting. This is the usage most people meet first, because it is how code is formatted on GitHub, Stack Overflow, Slack, Discord and most documentation tools.

In JavaScript, backticks delimit a template literal. Unlike quoted strings, a template literal may span multiple lines and may embed expressions using ${ }, which are evaluated and inserted. In Unix shells, a command wrapped in backticks is executed and replaced by its output — the older form of command substitution, now generally written $( ) instead because that form nests cleanly and is easier to read. In MySQL, backticks quote table and column names, which is how you refer to an identifier that collides with a reserved word or contains unusual characters.

Examples of Backtick Usage

  1. Markdown inline code. Wrapping a word in single backticks renders it in a monospaced code style rather than as prose.
  2. Markdown fenced code block. Three backticks on a line open a block, three more close it, and a language name after the opening fence enables syntax highlighting.
  3. JavaScript template literal. A backtick-delimited string can run across several lines and interpolate values with ${ }, avoiding manual concatenation.
  4. Shell command substitution. A command inside backticks runs first and its output is substituted in place. The modern equivalent is $( ).
  5. MySQL identifier quoting. Backticks around a table or column name let you use a reserved word, or a name containing spaces, as an identifier.

Frequently Asked Questions

Where is the backtick key on my keyboard?

On standard US and UK layouts it is the key immediately left of the 1 key and below Esc, shared with the tilde. Press it unshifted for a backtick and with Shift for a tilde. Positions differ on other national layouts; on some, including several European ones, it is a dead key.

What is the difference between a backtick and an apostrophe?

They are distinct characters that lean in opposite directions. The backtick (`) is the grave accent at U+0060; the apostrophe or single quote (') is U+0027. Code that expects one will usually fail if given the other, which is a common source of confusing syntax errors.

Why does my backtick not appear until I type another letter?

Your keyboard layout treats it as a dead key, which is how accented characters are produced. It waits to see whether the next keystroke is a vowel, giving à or è. Pressing the backtick key and then the spacebar normally produces the standalone character.

What do three backticks do?

In Markdown, three backticks open a fenced code block and three more close it. Everything between is rendered verbatim in monospace without Markdown formatting applied. Adding a language name after the opening fence turns on syntax highlighting.

Are backticks still the right way to run a command in a shell script?

They work, but $( ) is preferred in current practice. It nests without awkward escaping and is easier to read, and most shell style guides recommend it over the backtick form.

What is a backtick called in other contexts?

Backquote and grave accent are the common alternatives. Unicode names the character GRAVE ACCENT; developers usually say backtick, and documentation about accented characters usually says grave accent.

Related Tech Terms

  • Markdown
  • Template Literal
  • Command Substitution
  • Unicode
  • Escape Character

Sources for More Information

Who writes our content?

The DevX Technology Glossary is reviewed by technology experts and writers from our community. Terms and definitions continue to go under updates to stay relevant and up-to-date. These experts help us maintain the almost 10,000+ technology terms on DevX. Our reviewers have a strong technical background in software development, engineering, and startup businesses. They are experts with real-world experience working in the tech industry and academia.

See our full expert review panel.

These experts include:

Are our perspectives unique?

We provide our own personal perspectives and expert insights when reviewing and writing the terms. Each term includes unique information that you would not find anywhere else on the internet. That is why people around the world continue to come to DevX for education and insights.

What is our editorial process?

At DevX, we’re dedicated to tech entrepreneurship. Our team closely follows industry shifts, new products, AI breakthroughs, technology trends, and funding announcements. Articles undergo thorough editing to ensure accuracy and clarity, reflecting DevX’s style and supporting entrepreneurs in the tech sphere.

See our full editorial policy.

More Technology Terms

DevX Technology Glossary

Table of Contents