The complete Markdown syntax cheat sheet
Every Markdown syntax — headings, bold, italic, lists, links, images, code, tables, footnotes — in one copy-paste reference. CommonMark and GitHub Flavored.
The full Markdown syntax reference, in one page. Covers CommonMark (the formal standard) and GitHub Flavored Markdown extensions (tables, task lists, strikethrough). Bookmark-able; copy-pasteable.
If you're new to Markdown, start with What is Markdown? A complete guide. If you want to see this rendered in a real editor, paste the snippets into Markdown Tidy.
Headings
# H1
## H2
### H3
#### H4
##### H5
###### H6
ATX-style (hash characters) is the modern convention. The older "Setext" style (underlining with === for H1 or --- for H2) still works but reads worse in source.
Bold, italic, strikethrough
**bold** or **bold**
_italic_ or _italic_
**_bold italic_** or **_bold italic_**
~~strikethrough~~ (GFM)
In Slack, this works differently - *bold* is single-asterisk. See Markdown in Slack.
Paragraphs and line breaks
Paragraphs are separated by blank lines.
A single newline
joins lines into one paragraph.
A line ending in two spaces
forces a line break inside a paragraph.
Lists
- Unordered
- Item
- Nested (two-space indent)
1. Ordered
2. Item
1. Nested ordered
- [ ] Unchecked task (GFM)
- [x] Done task (GFM)
See Markdown lists for the full list rules - nesting, paragraphs inside items, mixing ordered + unordered.
Links
[Inline link](https://example.com)
[Link with title](https://example.com 'Hover title')
[Reference link][ref]
[ref]: https://example.com 'Optional title'
<https://example.com> (autolink — GFM auto-converts bare URLs too)
Images


![Alt][image-ref]
[image-ref]: path/to/image.png
Code
`inline code` — wrap with single backticks.
Use ``backticks containing ` characters`` with two-backtick fences.
Fenced code blocks:
```
no language
```
```python
def hello():
print("with language hint — syntax highlighted")
```
```js
const greet = () => console.log('any language tag works');
```
See Markdown code blocks for the full rules - escape characters, indented vs fenced, mixed languages, etc.
Blockquotes
> A single quoted line.
>
> Multiple paragraphs by repeating `>` on blank-ish lines.
>
> > Nested quote.
Tables (GFM)
| Header 1 | Header 2 | Right-aligned |
| -------- | :------: | ------------: |
| Cell | Centered | Right cell |
| Row 2 | Cell | 99,999 |
The colon in the delimiter row (:--, :-:, --:) controls alignment. Tables don't exist in pure CommonMark - they're a GFM extension. Most renderers support them.
If your AI-generated tables are broken, see How to repair broken Markdown tables in 30 seconds.
Horizontal rules
---
(three or more hyphens, asterisks, or underscores on their own line)
Escaping
To render a Markdown character literally, escape it with \:
\*literal asterisk\*
\[literal brackets\]
\`literal backtick\`
\# literal hash
HTML inside Markdown
Most renderers accept inline HTML:
This paragraph contains <em>HTML emphasis</em> and a <span style="color: red">red span</span>.
<div class="callout">
A block-level HTML div with **Markdown still parsed inside**.
</div>
The caveat: HTML inside Markdown is a security risk if your input isn't trusted. Most renderers (and Markdown Tidy's HTML renderer) disable raw HTML by default for persisted output.
Footnotes (GFM / extended)
Here's a footnote reference[^1] and another[^longnote].
[^1]: This is the first footnote.
[^longnote]:
Long footnotes can span paragraphs. Indent
continuation lines with four spaces.
Supported in GFM and most extended dialects. Not in strict CommonMark.
Definition lists (extended)
Term
: Definition for the term.
Another term
: Definition.
Not in CommonMark or GFM. Supported by Pandoc, kramdown, and a few others.
Mentions, emoji, autolinks (GFM)
@username — links to a user (on GitHub)
#1234 — links to issue/PR number (on GitHub)
:smile: — emoji shortcode (on many GFM renderers)
https://example.com — auto-detected and linked
These are GFM-specific. Behavior varies by host (GitHub, Gitea, GitLab).
Math (extended)
Inline math: $E = mc^2$
Block math:
$$
\int_a^b f(x)\,dx = F(b) - F(a)
$$
Supported by KaTeX/MathJax-equipped renderers, Jupyter notebooks, and many static-site generators. Not in core CommonMark.
Frontmatter (YAML)
---
title: My post
publishedAt: 2026-05-21
tags: [howto, markdown]
---
The content starts here.
Used by static-site generators (Jekyll, Hugo, Astro, Next.js) and tools like Markdown Tidy's blog system to extract metadata.
Platform variations
The same Markdown source renders differently in different places:
- Discord - supports a subset + spoilers. See Markdown in Discord.
- Slack - single-asterisk bold, no headings, no tables. See Markdown in Slack.
- Confluence - needs explicit conversion. See Confluence and Markdown.
- Jupyter notebooks - adds LaTeX math + interactive widgets. See GitHub Flavored Markdown.
What this cheat sheet doesn't cover
- MDX - Markdown + JSX components. A different beast; covered by the Astro/Next.js docs.
- Pandoc Markdown - adds a lot beyond GFM (figures, citations, tables-with-rowspan).
- AsciiDoc, reStructuredText, Org-mode - different markup languages that aren't Markdown.
For converting Markdown into a polished document - PDF, Word, HTML - see Markdown to PDF, Markdown to Word, and Markdown to HTML. Or paste it into Markdown Tidy's editor and Export.
Related articles
Markdown to Word (.docx): the right way to convert
Three working methods to convert Markdown to a Microsoft Word .docx — Pandoc, a web converter, and an editor export. Plus when DOCX beats PDF.
Introducing AI Assist: explain, beautify and transform any selection in the editor
Select any text in the Markdown Tidy editor and let AI explain it, polish it, or apply a custom instruction — inserted on a new line, never overwriting your work.
What is Markdown? A complete guide with examples
Markdown is a lightweight markup language for plain-text formatting. This guide covers the syntax, the dialects, and how to convert Markdown to PDF, Word, and HTML.
Why ChatGPT Markdown breaks in Google Docs (and how to fix it)
Asterisks instead of bold, hashes instead of headings, mangled tables — here's why AI-generated Markdown breaks when you paste it into Google Docs, and the cleanest way to get a proper document.