Markdown is the plain-text formatting syntax behind READMEs, docs, wikis, forum posts and chat apps. This markdown cheat sheet covers the syntax you reach for every day — headings, emphasis, lists, links, images and code, plus the GitHub Flavored Markdown (GFM) extras like tables and task lists — with rendered results, five copy-ready snippets and the gotchas that silently break layouts.
Basic syntax: what you type vs what you get
| You type | You get |
|---|---|
# Heading | Top-level heading; # through ###### give six levels in total |
**bold** | bold — two underscores work too |
*italic* | italic — single underscores also work |
***bold italic*** | bold italic |
~~strikethrough~~ | |
- item | Bulleted list; * and + are equivalent markers |
1. item | Numbered list; indent nested items to align with the parent's text |
[text](https://example.com) | A clickable link — add "title" after the URL for a hover tooltip |
 | An embedded image; the alt text appears if the image can't load |
Headings need a space after the hashes — #Title stays plain text in most parsers. For a hard line break inside a paragraph, end the line with two spaces; a single Enter usually collapses into a space.
Code and blockquotes
Inline code
Wrap short code in single backticks: typing `const x = 1;` renders as const x = 1; in a monospace span. If the code itself contains a backtick, wrap the whole thing in double backticks instead.
Fenced code blocks
```js
function greet(name) {
return "Hello, " + name;
}
```
Three backticks (tildes work too) open and close the block. The language tag right after the opening fence — js, python, bash — switches on syntax highlighting in renderers that support it.
Blockquotes
Start a line with > to quote it: > cited text. Use >> for a quote nested inside another. Blockquotes can hold other Markdown, including lists and code blocks.
GFM extensions: tables, task lists, rules, footnotes
Tables
Markdown table syntax uses pipes for the columns and a mandatory separator row of hyphens under the header. Colons in that separator set the alignment: :--- left, :---: center, ---: right.
| Name | Role | Score |
| :---- | :--: | -----: |
| Ada | Dev | 98 |
| Grace | Ops | 91 |
The outer pipes are optional, but keeping them makes the source easier to scan. A pipe inside a cell's content must be escaped as \|.
Task lists
Inside a list, [ ] renders an empty checkbox and [x] a checked one. On GitHub these become real checkboxes in issues and pull requests:
- [x] Ship the parser
- [x] Write the docs
- [ ] Profit
Horizontal rules
Three or more hyphens, asterisks or underscores on their own line — ---, *** or ___ — render a horizontal rule. Keep blank lines around a hyphen rule so the line above isn't swallowed into a heading (the older Setext underline syntax).
Footnotes
Mark a spot with [^1] and define the note anywhere with [^1]: your note text. Renderers collect the definitions into a numbered list at the bottom of the page, with jump links in both directions.
Five copy-ready snippets
1. README badge

The Shields.io static badge pattern is badge/LABEL-MESSAGE-COLOR — swap the three parts to taste.
2. Table with alignment
| Feature | Free | Pro |
| ------- | :--: | ---: |
| Users | 1 | 10 |
| Support | — | 24/7 |
3. Task list
- [x] Outline the post
- [x] Draft the sections
- [ ] Add screenshots
- [ ] Publish
4. Collapsible details
<details>
<summary>Build log (click to expand)</summary>
All 42 tests passed in 3.2 s.
</details>
Raw HTML like this works inside Markdown on GitHub and many other renderers. Leave the blank line after the <summary> tag, or the content inside won't be parsed as Markdown.
5. Clickable image
[](https://example.com/report)
The whole image syntax nests inside the link's text slot — the brackets of the image sit exactly where the link text would go.
Common gotchas
- Blank lines around blocks. Put an empty line before and after headings, lists, code fences, tables and quotes. Without one, many parsers glue the block onto the paragraph above — the classic reason a list "doesn't render as a list".
- Escape literal punctuation with a backslash.
\*,\_,\#,\[,\]show the character instead of triggering formatting. This fixes the classic accident where a line like1986. What a season!turns into a numbered list — write1986\.instead. - No space inside links.
[text] (url)with a gap between the brackets and the parentheses is not a link; keep them adjacent. - Underscores inside words don't italicize.
foo_bar_bazstays literal, whilefoo*bar*bazemphasizes mid-word. Handy for file names, a trap when you expected the opposite. - The table separator row is mandatory. Without the
---row under the header, your pipes render as plain text, not a table.
Paste any of the examples above into the Markdown Preview editor and watch the HTML render live as you type — it runs entirely in your browser, so nothing you write is uploaded.