Markdown Cheat Sheet: Every Syntax You Need
Quick-reference guide to markdown syntax. Headings, emphasis, links, images, code blocks, tables, task lists, and GitHub Flavored Markdown extensions.
Last updated: March 4, 2026
Markdown lets you write formatted text with plain characters. Every heading, link, list, and code block uses a simple pattern you can memorize in an afternoon. This cheat sheet covers the full syntax, from the basics through GitHub Flavored Markdown (GFM) extensions. Bookmark it and come back when you forget something.
Headings
Prefix a line with # symbols. More hashes means a smaller heading. You get six levels.
# Heading 1## Heading 2### Heading 3#### Heading 4##### Heading 5###### Heading 6Always put a space after the #. Some parsers won’t recognize the heading without it.
There’s also an alternate syntax for H1 and H2 using underlines:
Heading 1=========
Heading 2---------Most people stick with # because it’s clearer and works at all six levels. For anchor IDs, best practices, and document structure tips, see the full headings guide.
Emphasis
Bold, italic, and combinations of both. Asterisks and underscores both work, but asterisks are more common.
| What you type | What you get |
|---|---|
*italic* or _italic_ | italic |
**bold** or __bold__ | bold |
***bold italic*** | bold italic |
~~strikethrough~~ |
Stick with asterisks for bold and italic. Underscores can cause problems mid-word (some_variable_name won’t italicize in most parsers, which is the correct behavior). For edge cases and platform differences, see the bold and italic guide and the strikethrough guide.
Links and Images
Links use [text](url). Images use . The ! prefix is the only difference.
[MDtoLink](https://mdtolink.com)[MDtoLink](https://mdtolink.com "Optional title text")
Reference-style links keep your paragraphs readable when you have many URLs:
Read the [getting started guide][1] or check the [API docs][api].
[1]: https://mdtolink.com/docs/getting-started[api]: https://mdtolink.com/docs/apiAutolinks work too. Wrapping a URL in angle brackets makes it clickable:
<https://mdtolink.com><user@example.com>GFM also auto-links bare URLs like https://mdtolink.com without angle brackets. For anchor links, reference-style links, and more, see the full links guide. For image sizing and captions, see the images guide.
Lists
Unordered lists use -, *, or +. Ordered lists use numbers followed by a period.
- Item one- Item two - Nested item - Another nested item
1. First2. Second3. ThirdThe actual numbers don’t matter for ordered lists. This renders the same:
1. First1. Second1. ThirdUsing 1. for every item makes reordering easier since you don’t have to renumber. For nesting rules and continuation, see the full lists guide.
Code
Inline code uses single backticks. Code blocks use triple backticks (fenced) or four-space indentation.
Use `console.log()` to debug.Fenced code blocks support language hints for syntax highlighting:
```javascriptfunction greet(name) { return `Hello, ${name}`;}```Common language identifiers: javascript, typescript, python, bash, json, html, css, sql, go, rust. See our code blocks guide for the full list.
Blockquotes
Prefix lines with >. Nest them by stacking > characters.
> This is a blockquote.>> It can span multiple paragraphs.
> Outer quote>> Nested quoteFor GitHub-style admonitions and creative uses, see the blockquotes guide.
Horizontal Rules
Three or more dashes, asterisks, or underscores on a line by themselves.
---***___All three produce the same output. Dashes (---) are the most common convention.
Tables
Tables use pipes and dashes. Alignment is controlled with colons.
| Left | Center | Right ||:-----|:------:|------:|| a | b | c || d | e | f |The outer pipes are optional, but they make the source easier to read. For a deeper look at tables, see our markdown tables guide.
Task Lists
GFM adds checkbox syntax. Use - [ ] for unchecked and - [x] for checked items.
- [x] Write the draft- [x] Add code examples- [ ] Proofread- [ ] PublishTask lists render as interactive checkboxes on GitHub. Other renderers may display them as static checkboxes or plain text. For project tracking templates and platform differences, see the task lists guide.
Footnotes
Not part of the original spec, but supported by GFM and most markdown processors.
Here's a claim that needs a source[^1].
[^1]: Source: https://example.com/researchThe footnote content can go anywhere in the document. The renderer collects them at the bottom. For multi-paragraph footnotes and citation patterns, see the footnotes guide.
Escaping Special Characters
Use a backslash to display characters that markdown normally interprets:
\* Not italic \*\# Not a heading\[Not a link\](nope)Characters you can escape: \, `, *, _, {}, [], (), #, +, -, ., !, |. For the complete list with examples, see the escape characters guide.
GitHub Flavored Markdown (GFM)
GFM extends standard markdown with features that GitHub, GitLab, and many other platforms support.
| Feature | Syntax | Standard Markdown? |
|---|---|---|
| Tables | pipe syntax | No (GFM extension) |
| Task lists | - [x] | No (GFM extension) |
| Strikethrough | ~~text~~ | No (GFM extension) |
| Autolinks | bare URLs | No (GFM extension) |
| Footnotes | [^1] | No (GFM extension) |
| Emoji shortcodes | :fire: | No (GFM extension) |
| Syntax highlighting | fenced + language | Partial (fenced is GFM) |
Most modern markdown renderers support the full GFM spec. If you’re writing for a specific platform, check which extensions it supports. For a deeper explanation, see What Is GitHub Flavored Markdown?. For emoji shortcodes, see the emoji guide.
HTML in Markdown
Markdown allows inline HTML when you need something the syntax doesn’t cover:
This has a <kbd>Ctrl</kbd> + <kbd>C</kbd> shortcut.
<details><summary>Click to expand</summary>
Hidden content here. Note the blank line after the summary tag.
</details>Not all renderers allow HTML. GitHub strips some tags for security. Sanitization rules vary by platform. For a full list of which tags work where, see the HTML in markdown guide.
Quick Reference Table
| Element | Syntax |
|---|---|
| Heading | # H1 through ###### H6 |
| Bold | **text** |
| Italic | *text* |
| Bold + Italic | ***text*** |
| Strikethrough | ~~text~~ |
| Link | [text](url) |
| Image |  |
| Inline code | `code` |
| Code block | ``` with language hint |
| Blockquote | > text |
| Unordered list | - item |
| Ordered list | 1. item |
| Horizontal rule | --- |
| Table | pipe and dash syntax |
| Task list | - [x] done |
| Footnote | [^1] |
Try It Out
The fastest way to practice markdown is to write it and see the output side by side. The MDtoLink editor renders your markdown in real time. When you’re done, publish it to a shareable URL with one click.
Need to convert markdown to raw HTML? The Markdown to HTML tool handles that too.
Founder, MDtoLink
David builds developer tools and writes about markdown workflows, documentation, and AI-assisted publishing.
Publish your markdown to a shareable URL
One command. Free to start. No credit card.