Markdown Reference · Basic syntax

Markdown Inline Code: Backtick Syntax Guide

Format functions, shell commands, and code variables cleanly using CommonMark backtick syntax.

CommonMarkCategory: Basic syntax
Primary SyntaxCommonMark
`const apiKey = process.env.KEY;`
``Use a literal `backtick` inside``

In technical writing, software engineering, and systems documentation, clearly differentiating code snippets from regular conversational prose is critical.

Inline code formatting allows you to highlight variable names, configuration flags, filesystem paths, SQL queries, and terminal commands directly within flowing paragraphs without breaking sentence structure.

In CommonMark and Oyma, inline code is marked using backtick characters (`) and rendered using the HTML <code> element with a monospace font.

Basic inline code syntax

To format text as inline code, wrap the target word or phrase in single backtick characters (`):

Run `pnpm verify` to execute all SEO gates and test suites.
The configuration file is located at `~/.config/app/settings.json`.

Every character inside the backtick delimiters is preserved verbatim:

Functions like `Array.prototype.map()` return a new array instance.

Disabling Markdown parsing with backticks

A key advantage of inline code is that it automatically disables Markdown syntax interpretation. Characters that would normally trigger bolding, italics, links, or HTML tags are rendered literally:

In Markdown, `*this is not italic*` and `<script>` tags are harmless plain text.

This makes inline code indispensable when documenting Markdown syntax itself, regular expressions, mathematical equations, and shell globs like *.md.

Escaping literal backticks inside inline code

What happens when the code you want to format contains a literal backtick? In JavaScript template literals, shell command substitution, or Markdown tutorials, backticks frequently appear inside code strings:

To include a backtick inside inline code, wrap the code snippet in double backticks ( “) and add a space on both sides of the inner content:

``Use the `⌘O` shortcut to open the command palette.``

When rendered, CommonMark strips the inner padding spaces and displays: Use the ⌘O shortcut to open the command palette..

Rules for multi-backtick delimiters in CommonMark

  1. The opening delimiter run can consist of any number of backticks (e.g., “ or ).
  2. The closing delimiter must contain the exact same number of backticks.
  3. If the code begins or ends with a backtick, exactly one space must separate the delimiter from the code content.
`` `curl -I https://getoyma.com` ``

Best practices for technical documentation

  1. Format filenames and paths: Always wrap filenames (site.config.ts), directories (src/content/), and relative paths in backticks to prevent word wrapping errors and distinguish files from prose.
  2. Format terminal flags: Commands like git status -s or ls -la should always be marked as inline code.
  3. Format environment variables: Variables like NODE_ENV=production or PORT=3000 stand out clearly when backticked.
  4. Avoid backticking entire sentences: Reserve inline code for discrete identifiers. Backticking large blocks of regular prose diminishes readability.

Editing inline code in Oyma

In Oyma on macOS, writing code is second nature:

  • Highlight any phrase and press the backtick key (`) to automatically wrap the selection in backticks.
  • In live preview, Oyma styles inline code with an elegant monospace font, subtle background chip, and precise padding.
  • When you click or navigate your cursor into the code chip, the delimiters reveal themselves instantly for surgical editing.
  • All files remain 100% portable CommonMark plain text on your Mac.

Frequently asked questions

How do I include a literal backtick inside inline code in Markdown?
To include a literal backtick, wrap the inline code in double backticks and add spaces around the inner content: `` `code with backtick` ``. The surrounding spaces are stripped in the rendered output, displaying the inner backtick cleanly.
Does Markdown parse formatting (like bold or italic) inside inline code?
No. Content inside backticks is treated as raw verbatim text. Asterisks, underscores, brackets, and HTML tags are rendered literally rather than parsed as Markdown markup.
When should I use inline code versus a fenced code block?
Use inline code (single backticks) for short identifiers, filenames (`package.json`), variables, keyboard keys, and CLI commands within a paragraph. Use fenced code blocks (triple backticks) for multi-line scripts and complete programs.
How does Oyma style inline code in the editor?
Oyma renders inline code with a dedicated monospace font stack, subtle background tint, and rounded borders, seamlessly concealing the bounding backticks when your cursor moves away.

Experience Inline Code with zero lock-in.

Write CommonMark notes directly on your Mac with native live preview and sovereign local storage.

One email when your invite is ready. No newsletter.