Markdown cheat sheet

Every piece of Markdown syntax on one page, with the exact characters to type and what they produce. Bookmark it, or paste any example into the editor to try it.

All the tools

In short

Markdown is a plain-text formatting syntax created by John Gruber in 2004. A hash starts a heading, asterisks make bold or italic, hyphens make bullets, brackets make links and pipes make tables. The basic elements work everywhere; extended elements such as tables, task lists and footnotes come from GitHub Flavored Markdown and are supported by most, but not all, renderers.

At a glance
Created2004, by John Gruber with Aaron Swartz
Formal specificationCommonMark, published 2014
Most common flavourGitHub Flavored Markdown (GFM)
File extension.md (also .markdown, .mdown, .mkd)
Basic elementsHeadings, emphasis, lists, links, images, code, blockquotes, rules
Extended elementsTables, task lists, strikethrough, footnotes, fenced code, auto-links
Not in MarkdownUnderline, colour, font size, columns, page breaks

Basic syntax

These elements are defined in the original Markdown specification and work in every renderer — GitHub, GitLab, Obsidian, Notion, Reddit, Discord, Slack and the tools on this site.

ElementSyntaxRenders as
Heading 1# HeadingThe largest heading; use one per document
Heading 2–6## Heading … ###### HeadingSection and sub-section headings
Bold**bold text**bold text
Italic*italic text*italic text
Bold and italic***both***both
Blockquote> quoted textAn indented quotation block
Ordered list1. First
2. Second
A numbered list
Unordered list- Item or * ItemA bulleted list
Nested listIndent two spaces under the parent itemA sub-list
Inline code`code`code in a monospace font
Horizontal rule--- on its own lineA dividing line
Link[link text](https://example.com)link text
Image![alt text](image.png)The image, with alt text for accessibility
Line breakEnd a line with two spaces, or a backslashA break within a paragraph
Escape a character\*not italic\**not italic* shown literally

Extended syntax

These come from GitHub Flavored Markdown (GFM) and related extensions. Most modern tools support them, but a few older or minimal renderers do not.

ElementSyntaxNotes
Table| Col A | Col B |
|-------|-------|
| a | b |
The second row is required; use the Markdown table generator instead of typing the pipes
Column alignment|:---|:---:|---:|Left, centre, right — colons in the separator row
Fenced code block```js … ```The language after the fence enables syntax highlighting where supported
Strikethrough~~struck~~struck
Task list- [x] done
- [ ] to do
Checkboxes; interactive on GitHub
Footnotetext[^1] … [^1]: NoteNumbered automatically; not supported everywhere
Heading ID## Heading {#custom-id}Lets you link to #custom-id; GFM auto-generates IDs from heading text
Definition listTerm
: Definition
Markdown Extra and Pandoc only
Emoji shortcode:tada:GitHub, Slack, Discord; not standard Markdown
Highlight==highlighted==Obsidian and some editors; not GFM
Subscript / superscriptH~2~O / X^2^Pandoc and Markdown Extra; use <sub> and <sup> HTML for GFM
Automatic URL linkPaste https://example.comGFM links it without brackets

Which flavour am I using?

"Markdown" is a family of dialects rather than one standard. The differences matter mostly for tables, footnotes and task lists.

FlavourUsed byTablesTask listsFootnotes
CommonMarkThe formal specification (2014); the baseline others build onNoNoNo
GitHub Flavored (GFM)GitHub, GitLab, most tools including this siteYesYesYes (GitHub since 2021)
ObsidianObsidian notesYesYesYes, plus wikilinks and callouts
PandocDocument conversion, academic writingYes (several styles)YesYes, plus citations and maths
Markdown ExtraPHP tools, some CMSsYesNoYes

Things that trip people up

Try any of it

Paste an example into the Markdown editor to see it render, open a file in the Markdown viewer, or use the Markdown converter to turn a finished document into a PDF or Word file.

Questions people ask

What is the difference between Markdown and GitHub Flavored Markdown?

CommonMark is the base specification. GitHub Flavored Markdown adds tables, task lists, strikethrough, automatic links and fenced code blocks, and is what most tools — including GitHub, GitLab and this site — actually implement.

How do I make a table in Markdown?

Write the header row with pipes, then a separator row of dashes, then the data rows: | A | B | on one line, |---|---| on the next. Colons in the separator row set alignment. The table generator on this site writes all of this for you.

How do I add a line break without a new paragraph?

End the line with two spaces, or with a backslash. A blank line starts a new paragraph instead.

Does Markdown support underline?

No. Standard Markdown has no underline syntax because underlined text is conventionally a link. Use HTML tags if your renderer allows raw HTML.

Can I use HTML in Markdown?

Usually, yes — most renderers pass raw HTML through, which is how people add underline, coloured text or embedded video. Some sanitise or strip it for security.

What file extension does Markdown use?

.md is standard; .markdown, .mdown and .mkd are also seen. All contain plain text.