Skip to content

Instantly share code, notes, and snippets.

@andrewpayne68
Last active May 11, 2026 07:01
Show Gist options
  • Select an option

  • Save andrewpayne68/e68bc7d6f3977c5e6410d669f41f3880 to your computer and use it in GitHub Desktop.

Select an option

Save andrewpayne68/e68bc7d6f3977c5e6410d669f41f3880 to your computer and use it in GitHub Desktop.
Gist's Markdown Cheat Sheet

GitHub Gist — Markdown Cheat Sheet

A complete reference for Markdown syntax supported on GitHub Gist (GitHub Flavored Markdown).


Headings

# H1 Heading
## H2 Heading
### H3 Heading
#### H4 Heading
##### H5 Heading
###### H6 Heading

H1 Heading

H2 Heading

H3 Heading

H4 Heading

H5 Heading
H6 Heading

Text Formatting

Syntax Result
**Bold** Bold
*Italic* Italic
***Bold and italic*** Bold and italic
~~Strikethrough~~ Strikethrough
`Inline code` Inline code

Blockquotes

> Single-level blockquote

> First level
>> Nested deeper
>>> Even deeper

Single-level blockquote

First level

Nested deeper


Lists

Unordered

- Item one
- Item two
  - Nested item
  - Another nested
    - Deeper still
  • Item one
  • Item two
    • Nested item
    • Another nested
      • Deeper still

Ordered

1. First item
2. Second item
   1. Nested ordered
3. Third item
  1. First item
  2. Second item
    1. Nested ordered
  3. Third item

Task Lists

- [x] Completed task
- [ ] Incomplete task
- [x] Another done item
  • Completed task
  • Incomplete task
  • Another done item

Code

Inline Code

Use `backticks` for inline code.

Fenced Code Blocks with Syntax Highlighting

```javascript
const greet = (name) => `Hello, ${name}!`;
console.log(greet("World"));
```
const greet = (name) => `Hello, ${name}!`;
console.log(greet("World"));
```python
def greet(name):
    return f"Hello, {name}!"
```
def greet(name):
    return f"Hello, {name}!"
```bash
echo "Hello, World!"
npm install
```
echo "Hello, World!"
npm install
```json
{
  "name": "project",
  "version": "1.0.0"
}
```
{
  "name": "project",
  "version": "1.0.0"
}

Diff Highlighting

```diff
- Removed line
+ Added line
  Unchanged line
```
- Removed line
+ Added line
  Unchanged line

Horizontal Rules

---
___
***

Links

[Link text](https://example.com)
[Link with title](https://example.com "Tooltip title")

https://example.com

<!-- Reference-style -->
[label]: https://example.com "Optional title"
[Link text][label]

GitHub GitHub with title


Images

![Alt text](https://example.com/image.png)
![Alt text](./local-image.png "Optional title")

<!-- Reference-style -->
[img]: https://example.com/image.png
![Alt text][img]

Tables

| Column 1     | Column 2     | Column 3      |
|--------------|:------------:|--------------:|
| Left-aligned | Centered     | Right-aligned |
| Cell data    | Cell data    | Cell data     |
Column 1 Column 2 Column 3
Left-aligned Centered Right-aligned
Cell data Cell data Cell data

Footnotes

Here is a sentence with a footnote.[^1]
Another sentence with a note.[^note]

[^1]: This is the first footnote.
[^note]: This is a named footnote.

Here is a sentence with a footnote.1 Another with a named note.2


Collapsible Sections (HTML)

<details>
  <summary>Click to expand</summary>

  Content goes here. Supports **Markdown** inside!

  - List item
  - Another item

</details>
Click to expand

Content goes here. Supports Markdown inside!

  • List item
  • Another item

Inline HTML

<kbd>Ctrl</kbd> + <kbd>C</kbd>

<mark>Highlighted text</mark>

H<sub>2</sub>O   and   x<sup>2</sup>

<br>

Ctrl + C

Highlighted text

H2O   and   x2


Emoji Shortcodes

:rocket:  :tada:   :+1:    :fire:
:warning: :bulb:   :eyes:  :heart:
:white_check_mark: :x:     :zap:

🚀 🎉 👍 🔥 ⚠️ 💡 👀 ❤️ ✅ ❌ ⚡


Escaping Characters

\*  Not italic \*
\#  Not a heading
\\  Literal backslash
\`  Literal backtick
\[  Literal bracket

*Not italic*   # Not a heading   `Not code`

Escapable characters: \ * _ { } [ ] ( ) # + - . !


Line Breaks & Paragraphs

Paragraph one.

Paragraph two — blank line above creates a new paragraph.

Line one (two trailing spaces)  
Line two — soft break, same paragraph

Quick Reference

Element Syntax
Bold **text**
Italic *text*
Bold + italic ***text***
Strikethrough ~~text~~
Inline code `code`
Link [label](url)
Image ![alt](url)
H1 – H6 # through ######
Blockquote > text
Ordered list 1. item
Unordered list - item
Task list - [x] done / - [ ] todo
Horizontal rule ---
Table | col | col |
Footnote [^1] + [^1]: text
Code block ```lang … ```
Collapsible <details><summary>…
Keyboard key <kbd>Enter</kbd>
Highlight <mark>text</mark>
Superscript <sup>text</sup>
Subscript <sub>text</sub>

GitHub Flavored Markdown · Full GFM Spec

Markdown Guide

Footnotes

  1. This is the first footnote.

  2. This is a named footnote.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment