Markdown Cheatsheet: From Beginner to Expert (2026)

What is Markdown

Markdown is a lightweight markup language created by John Gruber in 2004.

✍️ Author:DevToolbox Team📅 Updated:2026-06-24📎 References:RFC Standards

📌 Key Takeaways

✍️ Author:DevToolbox Team📅 Updated:2026-06-24📎 References:RFC Standards

📌 Key Takeaways

It uses simple symbols (#, *, -, >) instead of HTML tags, letting authors focus on content rather than formatting.

GitHub, Reddit, Stack Overflow, Notion, Yuque, Dev.to all support Markdown.

20 most common syntax

Headings

# H1 Heading

## H2 Heading

### H3 Heading

(up to H6)

Emphasis

*italic* or _italic_

**bold** or __bold__

***bold italic***

~~strikethrough~~

Lists

Unordered:

- item 1

- item 2

- sub-item

 

Ordered:

1. first

2. second

Links and images

[link text](https://example.com)

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

Code

Inline code: `const x = 1;`

Code block:

```javascript

function hello() {

console.log('Hello');

}

```

Quotes and dividers

> blockquote

>> nested quote

 

--- (three or more - for horizontal rule)

Tables

| Col1 | Col2 | Col3 |

| --- | --- | --- |

| A | B | C |

| D | E | F |

Task lists (GFM extension)

- [x] done

- [ ] todo

DevToolbox live preview

DevToolbox provides a real-time Markdown preview tool, write on the left, see rendering on the right:

https://devstoolbox.net/en/tools/markdown-preview.html

Supports full GitHub Flavored Markdown (GFM) syntax.

5 best practices

1. Blank line before/after headings (improves readability)

2. Blank lines between list items (avoids sub-list confusion)

3. Specify language in code blocks (better highlighting)

4. Add alt text to images (SEO + accessibility)

5. Use TOC for long documents ([TOC])

FAQ

Q1: Markdown or HTML?

A: Markdown is easier to read/write, HTML is more precise. Mix them for complex layouts.

 

Q2: Is Markdown the same across platforms?

A: Basic syntax is universal. Tables, task lists are GitHub Flavored Markdown extensions.

 

Q3: How to convert Markdown to PDF?

A: Use Pandoc, Typora, or DevToolbox Markdown to HTML converter.

 

Q4: How to write math formulas?

A: LaTeX syntax. $E = mc^2$ inline, $$ block-level.

 

Q5: Can Markdown draw flowcharts?

A: Yes, use Mermaid syntax in a ```mermaid code block.

Related tools

Markdown Preview: https://devstoolbox.net/en/tools/markdown-preview.html

Markdown to HTML: https://devstoolbox.net/en/tools/markdown-to-html.html

JSON Formatter: https://devstoolbox.net/en/tools/json-formatter.html

Article by DevToolbox. Try our free tools: https://devstoolbox.net

🔗 Share: 𝕏 📘 ✈️ 💬

FAQ: Common Questions

Q: Markdown 标题怎么写?

用 `#` 符号,1-6 个代表 H1-H6。例:`# 一级`、`## 二级`、`### 三级`。或用 Setext 风格:`标题\n=====` 是 H1。

Q: Markdown 链接怎么写?

内联:`[文本](URL "可选标题")`。引用:`[文本][id]`,再 `[id]: URL "标题"`。自动链接:`<URL>` 直接显示。

Q: Markdown 代码块怎么写?

行内代码用单反引号:`code`。多行代码块用三反引号 + 可选语言:\`\`\`python\nprint("hi")\n\`\`\` (高亮语法)。

🧰
Add to Home Screen
Works offline, launches instantly