Markdown Cheatsheet – Syntax, Examples & Best Practices

Learn Markdown syntax fast with this comprehensive, visual cheatsheet. Perfect for beginners and pros, this guide features raw Markdown examples, rendered previews, best practices, and tips for documentation, blogging, GitHub, and technical writing. Reference anytime you need to format notes, docs, or code with speed and consistency.

A close-up of a computer screen showing a markdown editor with both code and preview visible

What is Markdown?

Markdown is a lightweight markup language designed to make writing formatted text simple and human-readable. Created by John Gruber in 2004, it's now the standard for documentation, README files, static site generators, technical blogging, and note-taking.

With Markdown, you can create headings, lists, links, images, code blocks, tables, and more using plain text. It's portable, easy to learn, and works across platforms—from GitHub and Notion to WordPress and developer wikis. Different platforms may use slightly different "flavors" (e.g., GitHub Flavored Markdown), but the basics are universal.

Markdown Syntax Cheatsheet (2025 Edition)

Headings

# H1
## H2
### H3
#### H4
H1
H2
H3
H4
Use # for headings. More # = smaller heading. Always start with H1 or H2 for clarity.

Emphasis

*italic* _italic_
**bold** __bold__
~~strike~~
italic bold strike
Use * or _ for italics, ** or __ for bold. Nest for bold italic.

Lists

- Item 1
- Item 2
- Nested
1. First
2. Second
  • Item 1
  • Item 2
    • Nested
  1. First
  2. Second
Use -, *, or + for bullets; numbers for ordered lists. Indent 2+ spaces for nesting.

Links & Images

[Title](url)
![Alt](url)
Links: [text](url)
Images: ![alt text](url) (always use alt text for accessibility & SEO).

Code

`inline code`

console.log('hi');
inline code
console.log('hi');
Use backticks ` for inline code, triple backticks for code blocks. Optionally specify language ().

Blockquotes

> This is a quote
This is a quote
Prefix with > for blockquotes. Useful for quotes or notes.

Tables

| Col | Col2 |
|---|---|
| A | B |
ColCol2
AB
Use pipes | and dashes - for tables. Align with :-- (left), :--: (center), --: (right).

Horizontal Rule

---
***
___

Use ---, ***, or ___ on a line for a divider.

Escaping

\*not italic\*
*not italic*
Prefix with \ to escape Markdown characters.

Advanced: Footnotes, Tasks, HTML

Task:
- [x] Done
- [ ] Todo
Footnote:
Here is a note.[^1]
[^1]: Footnote text
HTML: <u>underline</u>
  • Done
  • Todo
Here is a note.1
underline
Not all features (footnotes, tasks, HTML) are supported everywhere. Test in your target platform.

Markdown Formatting Best Practices

  • Keep formatting simple—stick to basic syntax for best portability across editors.
  • Use blank lines before/after headings, lists, and code blocks for clean output.
  • Always preview your Markdown before publishing or sharing.
  • Use descriptive alt text for images (improves accessibility and SEO).
  • Use consistent list markers and indentation for clarity.
  • Test tables and advanced features in your target platform (e.g., GitHub, Notion) for compatibility.
  • Stick to heading hierarchy (H1, H2, etc.)—don’t skip levels for accessibility.
Common Markdown Mistakes
  • Mixing tabs and spaces in lists—breaks formatting.
  • Forgetting blank lines before block elements.
  • Using non-standard features unsupported in some editors.
  • Not previewing before publishing—output may look different!
  • Forgetting alt text for images (hurts accessibility).
  • Skipping heading levels (H1 → H3)—bad for screen readers.

Markdown FAQ: Syntax, Usage & Compatibility

Not always—while the core syntax (headings, lists, emphasis, links) is very consistent, advanced features (tables, footnotes, task lists, embedded HTML) vary by platform. Always test your Markdown in your target editor or site (e.g., GitHub, Notion, Stack Overflow, static site generator) to confirm appearance and compatibility.

Markdown itself requires an image URL for embedding (e.g., ![Alt](https://example.com/img.png)). For local images, your Markdown renderer must support local file referencing—e.g., in static sites, ![Alt](./images/photo.jpg). For web platforms (GitHub, blogs), upload the image first and link to the hosted URL. Always add alt text for accessibility.

Yes—most Markdown renderers allow embedded HTML (e.g., <u>underline</u>). This is useful for advanced formatting not covered by Markdown (like custom classes or inline styles). However, HTML support varies by platform, and some editors sanitize HTML for security. Use HTML sparingly and always test the result.

Use the pipe-and-dash syntax:
| Name | Value |
|---|---|
| Foo | Bar |

Add : to set alignment (e.g., |:--|--:|). For complex tables, consider using a Markdown table generator tool, or convert from CSV. Note: Table support is not universal—check your platform’s documentation.

Markdown is plain-text and designed for speed, portability, and readability in source form. WYSIWYG editors (like Word or Google Docs) show live formatting but store content as complex HTML or proprietary formats. Markdown is ideal for version control (Git), documentation, and code, while WYSIWYG is better for print or visually complex layouts.

Related Markdown Tools & Utilities