Markdown Cheat Sheet: Complete Syntax Guide

Complete Markdown syntax reference with examples. Learn headers, lists, links, images, code blocks, and advanced formatting.

markdown November 23, 2025 (Updated: November 23, 2025) 5 min read

Markdown is a lightweight markup language that’s easy to read and write. It’s used everywhere from GitHub README files to documentation sites, blogs, and note-taking apps. This comprehensive cheat sheet covers all the essential Markdown syntax you need.

Headers

Create headers using hash symbols (#). More hashes = smaller header.

# H1 Header
## H2 Header
### H3 Header
#### H4 Header
##### H5 Header
###### H6 Header

Result:

H1 Header

H2 Header

H3 Header

Emphasis

Make text bold, italic, or both.

*Italic text* or _italic text_
**Bold text** or __bold text__
***Bold and italic*** or ___bold and italic___
~~Strikethrough text~~

Result:

  • Italic text
  • Bold text
  • Bold and italic
  • Strikethrough text

Lists

Unordered Lists

Use -, *, or + for bullet points.

- Item 1
- Item 2
  - Nested item 2.1
  - Nested item 2.2
- Item 3

Result:

  • Item 1
  • Item 2
    • Nested item 2.1
    • Nested item 2.2
  • Item 3

Ordered Lists

Use numbers followed by periods.

1. First item
2. Second item
   1. Nested item 2.1
   2. Nested item 2.2
3. Third item

Result:

  1. First item
  2. Second item
    1. Nested item 2.1
    2. Nested item 2.2
  3. Third item

Create clickable links with [text](url).

[FreeDataTools.dev](https://freedatatools.dev)
[Link with title](https://freedatatools.dev "Visit our site")

Result:

[Link text][reference]

[reference]: https://freedatatools.dev "Optional title"

Images

Similar to links, but with an exclamation mark at the start.

![Alt text](image-url.jpg)
![Alt text](image-url.jpg "Optional title")

Code

Inline Code

Use backticks for inline code.

Use the `console.log()` function to debug.

Code Blocks

Use triple backticks for code blocks. Add language for syntax highlighting.

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

Result:

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

Blockquotes

Use > for blockquotes.

> This is a blockquote.
> It can span multiple lines.
>
> > Nested blockquotes are also possible.

Result:

This is a blockquote. It can span multiple lines.

Nested blockquotes are also possible.

Horizontal Rules

Create horizontal lines with three or more hyphens, asterisks, or underscores.

---
***
___

Result:


Tables

Create tables using pipes and hyphens.

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Row 1    | Data     | Data     |
| Row 2    | Data     | Data     |

Result:

Header 1Header 2Header 3
Row 1DataData
Row 2DataData

Table Alignment

Use colons to align columns.

| Left | Center | Right |
|:-----|:------:|------:|
| L    | C      | R     |

Task Lists

Create checkboxes with - [ ] and - [x].

- [x] Completed task
- [ ] Incomplete task
- [ ] Another task

Result:

  • Completed task
  • Incomplete task
  • Another task

Escaping Characters

Use backslash to escape Markdown characters.

\*This text is not italic\*
\# This is not a header

HTML in Markdown

You can use HTML tags directly in Markdown.

<div style="color: blue;">
  This text is blue.
</div>

<details>
  <summary>Click to expand</summary>
  Hidden content here.
</details>

Advanced Features

Footnotes

Here's a sentence with a footnote[^1].

[^1]: This is the footnote content.

Definition Lists

Term
: Definition of the term

Another term
: Another definition

Abbreviations

The HTML specification is maintained by the W3C.

*[HTML]: Hyper Text Markup Language
*[W3C]: World Wide Web Consortium

GitHub Flavored Markdown (GFM)

Syntax Highlighting

Specify language for code blocks:

```python
def hello():
    print("Hello, World!")
```

Emoji

Use :emoji_name: for emoji.

:smile: :heart: :rocket:

Mentions and References

@username
#123 (issue reference)
SHA: a5c3785ed8d6a35868bc169f07e40e889087fd2e

Best Practices

  1. Use consistent formatting - Pick one style for lists, emphasis, etc.
  2. Add blank lines - Separate blocks with blank lines for readability
  3. Use meaningful link text - Avoid “click here”
  4. Include alt text for images - Important for accessibility
  5. Preview before publishing - Use a Markdown preview tool
  6. Keep lines short - Aim for 80-100 characters per line
  7. Use headers hierarchically - Don’t skip levels (H1 → H3)

Markdown Preview

Test your Markdown syntax with our live preview tool

Try Tool →

Common Use Cases

README Files

# Project Name

Brief description of your project.

## Installation

\`\`\`bash
npm install project-name
\`\`\`

## Usage

\`\`\`javascript
const project = require('project-name');
\`\`\`

## License

MIT

Documentation

## API Reference

### `functionName(param1, param2)`

Description of the function.

**Parameters:**
- `param1` (string): Description
- `param2` (number): Description

**Returns:** Description of return value

**Example:**
\`\`\`javascript
functionName('hello', 42);
\`\`\`

Blog Posts

---
title: My Blog Post
date: 2025-01-15
tags: [markdown, blogging]
---

# My Blog Post

Introduction paragraph...

## Section 1

Content here...

Markdown Flavors

Different platforms support different Markdown features:

  • CommonMark - Standard specification
  • GitHub Flavored Markdown (GFM) - GitHub’s version
  • Markdown Extra - PHP Markdown with extensions
  • MultiMarkdown - Adds tables, footnotes, citations
  • R Markdown - For R programming and data science

Tools and Editors

  • VS Code - Built-in Markdown preview
  • Typora - WYSIWYG Markdown editor
  • Obsidian - Note-taking with Markdown
  • HackMD - Collaborative Markdown editor
  • Dillinger - Online Markdown editor

HTML to Markdown Converter

Already have HTML content? Convert it to Markdown instantly

Try Tool →

Quick Reference Table

ElementSyntax
Header# H1 to ###### H6
Bold**text** or __text__
Italic*text* or _text_
Link[text](url)
Image![alt](url)
Code`code`
Code Block```language
List- item or 1. item
Blockquote> quote
Horizontal Rule---
Table`

Conclusion

Markdown is an essential skill for developers, technical writers, and content creators. Its simplicity and readability make it perfect for documentation, README files, and content management. Bookmark this cheat sheet and refer back whenever you need a quick syntax reminder!

Related Resources