Markdown Cheatsheet
A complete Markdown cheatsheet from beginner to advanced — headings, emphasis, lists, links, images, tables, code blocks, task lists, footnotes, GFM features, and advanced tips for GitHub, documentation, and static sites.
Markdown is a lightweight markup language that lets you write formatted text using plain text. It is widely used for README files, documentation, notes, blogs, and static sites. This cheatsheet covers standard Markdown, GitHub Flavored Markdown (GFM), and useful advanced features.
# Heading 1## Heading 2### Heading 3#### Heading 4##### Heading 5###### Heading 6Alternative (Setext style, limited support):
Heading 1=========
Heading 2---------*italic* or _italic_**bold** or __bold__***bold italic*** or ___bold italic___~~strikethrough~~ (GFM)==highlight== (some processors)You can combine them:
**This is bold and _italic_ inside**- Item 1- Item 2 - Nested item - Another nested- Item 3
* Asterisks also work+ Plus signs also work1. First2. Second3. Third 1. Nested ordered 2. Another- [x] Completed task- [ ] Incomplete task- [ ] Another task[Link text](https://example.com)[Link with title](https://example.com "Title text")[Reference link][id]
[id]: https://example.com "Optional title"Autolinks (GFM):
https://example.com<https://example.com>![Alt text][image-id]
[image-id]: image.jpg "Optional title"Linked image:
[](https://example.com)Use `backticks` for inline code.Fenced code blocks (recommended):
```jsfunction hello() { console.log("Hello, world!");}```With language for syntax highlighting:
```pythondef greet(name): print(f"Hello, {name}")```Indented code blocks (4 spaces or 1 tab):
function oldStyle() { return true; }> This is a blockquote.> It can span multiple lines.>> > Nested blockquote---***___| Name | Age | City ||---------|-----|----------|| Rahim | 28 | Dhaka || Karim | 34 | Chittagong || Ayesha | 25 | Sylhet |Alignment:
| Left | Center | Right ||:---------|:--------:|---------:|| left | center | right |Here is a sentence with a footnote.[^1]
[^1]: This is the footnote content.Some processors also support named footnotes:
Reference to something[^note].
[^note]: Detailed explanation here.Term 1: Definition of term 1
Term 2: Definition of term 2(Supported in some processors like pandoc, not all.)
To display literal Markdown characters:
\* This will not be italic \*\` inline code \`\# Not a headingMost processors allow raw HTML:
<div style="color: red;"> This is raw HTML.</div>
<details> <summary>Click to expand</summary> Hidden content here.</details>
<kbd>Ctrl</kbd> + <kbd>C</kbd>### Project Progress- [x] Design mockups- [x] Set up repository- [ ] Write documentation- [ ] Deploy to production@username <!-- mention (GitHub) -->#123 <!-- issue / PR reference -->owner/repo#123 <!-- cross-repo reference -->Strikethrough:
~~Deleted text~~Inline math:
Einstein's equation: $E = mc^2$Block math:
$$\int_{a}^{b} f(x)\,dx = F(b) - F(a)$$(Requires MathJax / KaTeX support.)
```mermaidgraph TD A[Start] --> B{Decision} B -->|Yes| C[Do this] B -->|No| D[Do that]```Sequence diagram example:
```mermaidsequenceDiagram Alice->>Bob: Hello Bob Bob-->>Alice: Hi Alice```---title: My Documentdescription: A short descriptiondate: 2026-11-11tags: [markdown, cheatsheet]---
# Content starts here- Two spaces at end of line + Enter → hard line break
- Blank line → new paragraph
1. First item - Nested unordered - Another2. Second item ```js console.log("code inside list");### Collapsible Sections (HTML)```markdown<details><summary>Click to expand</summary>
Hidden Markdown content supports **formatting**.
</details>[//]: # (This is a comment)<!-- HTML comment also works -->- Prefer fenced code blocks over indented ones.
- Use relative links for internal documentation.
- Keep line length reasonable (80–100 characters) for readability in editors.
- Use ATX-style headings (
#) instead of Setext. - Be consistent with list markers (
-or*). - Test rendering on your target platform (GitHub, VS Code, Astro, Hugo, etc.).
- Avoid deep nesting of lists and blockquotes.
- Use reference-style links when the same URL is used multiple times.
- Write meaningful alt text for images (accessibility).
- Stick to CommonMark + GFM for maximum portability.
# Heading**bold** *italic* ~~strike~~[link](url) - list item1. ordered item- [x] task`inline code````code```> blockquote| table | row |---[^1] footnote- CommonMark Spec: https://commonmark.org
- GitHub Flavored Markdown Spec: https://github.github.com/gfm/
- Markdown Guide: https://www.markdownguide.org
- MDN Markdown: https://developer.mozilla.org/en-US/docs/MDN/Writing_guidelines/Howto/Markdown_in_MDN
- Mermaid Docs: https://mermaid.js.org
Markdown support varies by platform. GitHub, GitLab, VS Code, Obsidian, Notion, and most static site generators support GFM + useful extensions. Always preview when using advanced features.
Frequently asked questions
What is the difference between Markdown and HTML?
Markdown is a simple plain-text formatting syntax that converts to HTML. It is easier to write and read than raw HTML, but less powerful for complex layouts.
What is GitHub Flavored Markdown (GFM)?
GFM is GitHub's extended version of Markdown. It adds tables, task lists, strikethrough, autolinks, and other useful features on top of standard Markdown.
How do I add a line break in Markdown?
End a line with two or more spaces and then press Enter, or use a blank line for a new paragraph. Some processors also support a trailing backslash.
Can I use HTML inside Markdown?
Yes. Most Markdown processors allow raw HTML tags when you need formatting that Markdown does not support.
What is the best way to write portable Markdown?
Stick to common syntax (CommonMark + GFM), avoid obscure extensions, use relative links for local files, and test rendering on your target platform.