Markdown Cheat Sheet (English)

A quick reference for common Markdown syntax plus popular “GitHub-flavored” extras. All examples are formatted in code style so you can copy/paste directly.

Quick links

Headings Emphasis Lists Links Images Blockquotes Code Horizontal rules Tables Task lists Footnotes Anchors / internal links Escaping special characters HTML in Markdown Practical tips

Notes

Some features (e.g., task lists, tables, footnotes) depend on the platform/renderer. GitHub, GitLab and many wikis support “GFM” (GitHub Flavored Markdown) extensions.

Line breaks: in most Markdown flavors, a newline inside a paragraph becomes a soft wrap. For a hard line break, add two spaces at the end of the line.

Headings Basics

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6
Tip: Always add a space after the # symbols.

Emphasis Basics

Italic, bold, strikethrough

*italic* or _italic_
**bold** or __bold__
~~strikethrough~~

Subscript & superscript (platform-dependent)

H<sub>2</sub>O (via HTML)
x<sup>2</sup> (via HTML)
Sub/superscript are not standard Markdown—use HTML where needed.

Lists Basics

Unordered list

- First item
- Second item
  - Nested item
  - Another nested item
- Third item

Ordered list

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

Auto-numbered ordered list

1. First item
1. Second item
1. Third item
For nested lists, use indentation (e.g., 2 spaces or a tab) and keep it consistent.

Images Basics

Basic syntax

![Alt text](https://example.com/image.png)

Image with a title

![Alt text](https://example.com/logo.png "My logo")

Image sizing (not standard; use HTML)

<img src="https://example.com/image.png" alt="Alt text" width="240" />
If the platform doesn’t support sizing in Markdown, HTML is the most reliable option.

Blockquotes Basics

Single-line quote

> This is a quote.

Multi-line quote

> First quoted line
> second quoted line
>
> New paragraph inside the quote

Quote with a list

> Key points:
> - Point A
> - Point B

Code Basics

Inline code

Run `npm install` to install dependencies.

Fenced code block

```text
This is a code block.
Put commands, configuration, or output here.
```

Syntax highlighting (language tag)

```js
function greet(name) {
  console.log(`Hello, ${name}!`);
}
```

Indented code block (older style)

    This is a code block that starts with 4 spaces.
    Use it if fenced code blocks are not supported.
If inline code contains backticks (`), wrap it using double or triple backticks.

Horizontal rules Basics

---
***
___
Keep a blank line around the rule to avoid unexpected parsing.

Tables GFM

Simple table

| Column A | Column B |
|---------:|:---------|
| Right aligned | Left aligned |
| 123 | Text |
Alignment: :--- (left), ---: (right), :---: (center). Avoid very long code inside tables—use separate code blocks instead.

Task lists GFM

- [ ] Incomplete task
- [x] Completed task
  - [ ] Subtask
Task lists work great in GitHub issues and pull request descriptions.

Footnotes Platform-dependent

This is a statement with a footnote.[^1]

[^1]: This is the footnote text.
Not every Markdown engine supports footnotes. If it doesn’t work, use regular links instead.

Anchors / internal links Practical

Link to a heading anchor (GitHub-style)

[Jump to Code](#code)

Manual anchor ID (via HTML)

<a id="my-anchor"></a>
[Jump](#my-anchor)
Automatic heading IDs vary by platform (how it treats spaces, punctuation, and non-ASCII characters).

Escaping special characters Basics

Escape Markdown characters with a backslash

\*This will not be italic\*
\# This is not a heading
\> This is not a quote

HTML entities (the most reliable)

&lt;div&gt;This looks like HTML, but it won't render as HTML.&lt;/div&gt;

HTML in Markdown Mixed mode

Hard line break (HTML)

First line<br>
Second line

Centered text / custom layout (HTML)

<div style="text-align:center">
  <strong>Centered text</strong>
</div>
Some platforms restrict HTML for security reasons (e.g., scripts, certain inline styles).

Practical tips Everyday

Hard line break inside a paragraph (two trailing spaces)

This is the first line␠␠
This is the second line (same paragraph)

Paragraph inside a list item

- Item 1

  This paragraph belongs to the same list item (indented).
- Item 2

“Callout” style note (platform-dependent)

> **Note:** This is important information.

Front matter (e.g., Jekyll, Hugo)

---
title: "My document"
date: 2026-04-10
tags: [markdown, reference]
---
If you use a static-site generator, check which front matter format (YAML/TOML/JSON) it expects.