Markdown Cheat Sheet
Every piece of Markdown syntax on one page, with the code to type and what it shows. Each row links to a full guide, and the page prints on a few sheets to keep next to your keyboard.
Basic syntax
| Element | Markdown | Result |
|---|---|---|
| Headings | # Heading 1 ## Heading 2 ### Heading 3 | Heading 1
Heading 2
Heading 3 |
| Bold | **bold text** | bold text |
| Italic | *italic text* | italic text |
| Blockquotes | > quoted text |
|
| Bulleted list | - First item - Second item |
|
| Numbered list | 1. First item 2. Second item |
|
| Inline code | Run `npm install` | Run |
| Code block | ```js
console.log("hi");
``` | |
| Links | [Example](https://example.com) | |
| Images |  | |
| Horizontal lines | --- | |
| Line breaks | First line\ second line | First line |
| Escaping characters | \*not italic\* | *not italic* |
Extended syntax
| Element | Markdown | Result | ||||
|---|---|---|---|---|---|---|
| Tables | | Name | Role | | --- | --- | | Ana | Design | |
| ||||
| Task lists | - [x] Done - [ ] To do |
| ||||
| Strikethrough | ~~struck text~~ |
| ||||
| Footnotes | A claim.[^1] [^1]: The source. | |||||
| Highlight | <mark>highlighted</mark> | highlighted | ||||
| Math and LaTeX | $E = mc^2$ |
Formatting with HTML
| Element | Markdown | Result |
|---|---|---|
| Underline | <ins>underlined</ins> | underlined |
| Comments | <!-- hidden note --> | Nothing is displayed |
| Text color | $\color{#d1242f}{\text{red text}}$ | |
| Center and align | <p align="center">centered text</p> | centered text |
| Collapsible sections | <details> <summary>Click to open</summary> Hidden text </details> | Click to openHidden text |
| Superscript and subscript | x<sup>2</sup> and H<sub>2</sub>O | x2 and H2O |
Questions and answers
What is Markdown?
A way to format plain text with symbols such as
# for headings and ** for bold. The text stays readable as it is, and apps turn it into formatted pages, documents and messages.What is the difference between basic and extended syntax?
Basic syntax is the core that every Markdown app supports, now specified as CommonMark. Extended syntax adds tables, task lists, strikethrough, footnotes and more; most of it comes from GitHub Flavored Markdown and works in most, though not all, apps.
Is Markdown the same on GitHub?
GitHub uses GitHub Flavored Markdown: all of the basic syntax plus tables, task lists, strikethrough, footnotes, automatic links, alerts and math. Everything in the first two groups of this sheet works there.
Can I use HTML inside Markdown?
Most renderers accept inline HTML, which is how underline, centering and collapsible sections are written. Sites clean it for safety: GitHub, for example, keeps
<ins>, <sup> and align but removes style.What file extension do Markdown files use?
.md is the most common, and .markdown works too. Both are plain text files that any editor can open.How do I print this cheat sheet or save it as a PDF?
Use the Print button above the tables, or your browser's print command, and choose Save as PDF as the printer for a PDF. The header, footer and questions are left out of the printout.
Why does my Markdown look different on another site?
Apps support different extensions and handle HTML differently. Each guide on this site lists how GitHub, Discord, Slack, Obsidian and other apps treat its syntax.
Where can I try Markdown?
Open Markdown Live Preview and type on the left to see the result on the right.