What is a Markdown cheatsheet?
Markdown is a way of writing formatted text using plain characters. You type **bold** and a renderer shows bold. It is the format of README files, pull request descriptions, documentation sites, static blogs and many note-taking apps, so most developers write a little of it every day. The basic syntax is small, but the details are easy to forget: how to make a table, how to escape an asterisk, which extras work only on GitHub.
This page is a searchable list of the syntax, grouped in seven sections: headings and paragraphs, emphasis, lists, links and images, code and quotes, tables, and extras. Every item has a short description and the exact text to type, ready to copy. Where a feature belongs to GitHub Flavored Markdown (GFM) or to a specific platform, the description says so. In this list that includes strikethrough, task lists, footnotes, the note and warning boxes (> [!NOTE]), math formulas and Mermaid diagrams. Other renderers may show them as plain text, so check where your document will be displayed.
Markdown has no single official specification that every tool follows. CommonMark defines the core, and GFM adds tables, task lists, strikethrough and autolinks on top of it. The page is plain reference material that runs in your browser, with no account and nothing sent anywhere. If you want to see the result of your text, convert it with the Markdown to HTML converter.
How to use the Markdown cheatsheet
- Open the page and scroll. The sections follow the order in which a document is usually written, from headings to the extras.
- Type in the search box to filter the items. The search looks at the description, the section title and the text of the examples, and all the words you type must match. It ignores accents and capital letters.
- Read the counter at the bottom to see how many items were found. If nothing matches, try a word such as table, link, code or task.
- Press the copy button next to an item to copy its text. An item with several lines is copied whole, with the line breaks.
- Use the copy section button in a section title to take every example of that section.
- Paste the text into your file and replace the sample words, URLs and file names with yours.
If you go the other way and have HTML to turn into Markdown, use the HTML to Markdown converter.
Examples
A table with aligned columns
The second line of a table separates the header and sets the alignment. Colons mark it: on the left for left, on both sides for center, on the right for right.
| Left | Center | Right |
|:-----|:------:|------:|
| a | b | c |The columns do not need to line up in the source. Spaces are only for reading. To put a pipe inside a cell, escape it as \|.
A task list and a note box (GitHub)
- [x] Write the draft
- [ ] Review the links
> [!WARNING]
> This step deletes data.On GitHub the first part becomes two checkboxes, and the quote becomes a highlighted warning box. Outside GitHub the checkboxes may appear as the literal text [ ] and the box as an ordinary quote starting with [!WARNING].
A link by reference and an anchor
Read the [guide][docs] or jump to [the install section](#install).
[docs]: https://example.com/docsThe reference is defined once and can be reused in many places. For the anchor, the heading ## Install becomes #install: lower case, spaces replaced by hyphens.
A collapsible section
<details>
<summary>Show the full log</summary>
Hidden content, with **Markdown** inside.
</details>This is HTML inside Markdown, and it works on GitHub. Keep the blank lines around the content, or the Markdown inside will not be rendered.
Common mistakes
The list or the code block does not render
Lists and quotes need a blank line before them in many renderers, and a code block opened with three backticks must be closed with three backticks. A missing closing fence turns the rest of the page into code.
The line break disappears
A single Enter inside a paragraph does not create a new line. Use a blank line for a new paragraph. For a break inside the paragraph, end the line with two spaces or with a backslash. Trailing spaces are invisible and are often removed by editors, so the backslash is safer.
Characters read as syntax
An asterisk, an underscore, a backtick or a hash at the start of a line can turn into formatting by surprise. Put a backslash before it, as in \*not italic\*. In file names, snake_case_name is usually safe, but * is not.
Extras that show up as plain text
Footnotes, math, Mermaid, alerts and task lists are not in the base specification. If your static site generator or app does not support them, they appear as literal text. Test in the real destination.
Headings without a space
#Title is not a heading in most renderers. The # must be followed by a space.
Frequently asked questions
What is the difference between Markdown and GitHub Flavored Markdown?
GFM is Markdown plus a few additions that GitHub documented: tables, task lists, strikethrough and automatic links. GitHub also renders things such as alerts, math, Mermaid diagrams and mentions of people and issues. The page marks the items that belong to GitHub.
Does Markdown support colors, underline or highlight?
Not in the syntax itself. You can use HTML such as <mark> for highlight, <sub> and <sup> for subscript and superscript, but each platform decides which HTML tags it lets through. GitHub removes style attributes, so colored text does not work there.
How do I write a literal asterisk or backtick?
Escape the character with a backslash, as in \*. For inline code that contains a backtick, wrap it in two backticks instead of one, with a space inside each end. The code section of the cheatsheet has the exact text.
Can I use Markdown in a commit message?
Git does not render it, so the message is shown as text. Platforms such as GitHub render Markdown in pull request descriptions and comments, but not in the commit title. For commit conventions, see the Conventional Commits guide.
Does the page send my text anywhere?
No. It is a static list. You only copy text from it.