Quire

How to get syntax highlighting in Markdown code blocks

Short answer: use a fenced code block and put the language name straight after the opening backticks, for example ```python. Without that label, many renderers show the code plain.

Updated 15 October 2026. Syntax follows the CommonMark spec and GitHub’s documentation; Quire details come from its source code.

Write a highlighted block

  1. Open a fence

    Start a line with three backticks (```) or three tildes (~~~).

  2. Name the language

    Right after the fence, with no space needed, write the language: ```python, ```js, ```bash. Use lowercase.

  3. Paste the code

    Put the code on the following lines, unchanged.

  4. Close the fence

    End with a line of the same characters, at least as many as you opened with.

In CommonMark the text after the opening fence is called the info string. Its first word is, by convention, the language. Markdown doesn’t define the list of names; each renderer decides which it knows.

Which language names work

Why a block stays plain

To show a fence inside a code block, as in a Markdown tutorial, wrap the outer block in four backticks.

Highlighted code in Chrome

Quire Markdown is our extension, free on the Chrome Web Store. It highlights fenced code labelled with one of these languages, or a common alias for one: Bash, C, C++, C#, CSS, diff, Go, GraphQL, INI and TOML, Java, JavaScript, JSON, Kotlin, Less, Lua, Makefile, Markdown, Objective-C, Perl, PHP, Python, R, Ruby, Rust, SCSS, shell sessions, SQL, Swift, TypeScript, VB.NET, WebAssembly, XML and HTML, and YAML.

Quire Markdown showing a rendered document with a heading outline on the left
Quire Markdown with its outline of headings.

Questions

Should I write ```js or ```javascript?

Both work in most renderers, including GitHub and Quire. Pick one and use it throughout your documents.

Can I highlight inline code?

Standard Markdown has no way to name a language for inline `code`. Some tools add their own syntax for it, which won’t carry over to others.

More guides

All guides · Quire homepage