Markdown is a lightweight markup language created by John Gruber in 2004 with the goal of making plain text as readable as possible while also being convertible to clean HTML. Today it powers documentation on GitHub, notes in Obsidian, messages in Slack and Discord, and — increasingly — the output of AI language models like ChatGPT and Claude. If you're working with any of these tools, knowing Markdown syntax will save you significant time.

This cheat sheet covers both the original "CommonMark" specification and the most widely supported extended syntax, complete with examples you can copy directly.

Basic Syntax

Headings

Use hash (#) characters to create headings. The number of hashes corresponds to the heading level (H1–H6).

# Heading 1 (H1)
## Heading 2 (H2)
### Heading 3 (H3)
#### Heading 4 (H4)
##### Heading 5 (H5)
###### Heading 6 (H6)

Always put a space between the hash characters and the heading text. Most parsers require this.

Emphasis

**bold text**
*italic text*
***bold and italic***
~~strikethrough~~

Asterisks (*) and underscores (_) both work for bold and italic, but mixing them in the same word can cause unexpected results. Stick to asterisks for consistency.

Paragraphs and Line Breaks

Separate paragraphs with a blank line. For a line break within a paragraph (without starting a new paragraph), end the line with two spaces or a backslash.

First paragraph.

Second paragraph.

Line one
Line two (two trailing spaces before the newline)

Unordered Lists

- Item one
- Item two
  - Nested item (indent with 2 spaces)
  - Another nested item
- Item three

You can use -, *, or + as list markers. Choose one and be consistent throughout a document.

Ordered Lists

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

The actual numbers don't matter — you can write 1. for every item and most renderers will auto-number them correctly. But using sequential numbers improves plain-text readability.

Links

[Link text](https://example.com)
[Link with title](https://example.com "Page title")
<https://example.com>  (auto-link)

Images

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

Blockquotes

> This is a blockquote.
> It can span multiple lines.
>
> And multiple paragraphs.

Horizontal Rule

Use three or more hyphens, asterisks, or underscores on their own line:

---
***
___

Inline Code

Use `backticks` for inline code.

Fenced Code Blocks

```python
def greet(name):
    return f"Hello, {name}!"
```

The language identifier after the opening fence enables syntax highlighting in most renderers. Common identifiers: python, javascript, typescript, bash, json, html, css, sql.

Extended Syntax

Extended syntax is supported by most modern Markdown processors (GitHub Flavored Markdown, Pandoc, Obsidian, etc.) but is not part of the original spec.

Tables

| Column 1 | Column 2 | Column 3 |
| -------- | -------- | -------- |
| Cell 1   | Cell 2   | Cell 3   |
| Cell 4   | Cell 5   | Cell 6   |

Column alignment is controlled by colons in the separator row:

| Left | Center | Right |
| :--- | :----: | ----: |
| A    | B      | C     |

Task Lists

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

Footnotes

Here is a claim that needs a reference.[^1]

[^1]: This is the footnote text.

Definition Lists

Term
: Definition of the term

Another term
: Its definition

Highlight

==highlighted text==

Subscript and Superscript

H~2~O (subscript)
X^2^ (superscript)

LaTeX Math

For scientific and academic writing, Pandoc and many Markdown editors support LaTeX math syntax:

Inline math: $E = mc^2$

Display math (centered block):
$$
\int_0^\infty e^{-x^2} dx = \frac{\sqrt{\pi}}{2}
$$

When converting to Word via ToFly.app (Pandoc), math expressions are converted to native Word equation objects that can be edited in Microsoft Equation Editor.

Escaping Special Characters

To display a character that would normally be interpreted as Markdown syntax, prefix it with a backslash:

\*not italic\*
\# not a heading

Characters that can be escaped: \\ ` * _ [] () # + - . !

Tips for AI-Generated Markdown

When using ChatGPT or Claude to generate Markdown content, a few prompting strategies consistently produce cleaner output:

  • Explicitly request the heading hierarchy: "Use H1 for the title, H2 for sections, and H3 for subsections."
  • Ask for tables when comparing options: "Present this in a Markdown table."
  • Request code fences with language IDs: "Wrap all code in fenced code blocks with the language identifier."
  • Avoid mixed list styles within a single document — specify either hyphens or numbers depending on content type.
  • For academic content, specify LaTeX math explicitly: "Write all mathematical expressions using LaTeX inline or display math syntax."

Once you have well-structured Markdown, converting it to a Word document with a tool like ToFly.app Markdown to Docx takes only a few seconds and preserves all formatting elements.

Quick Reference Card

ElementMarkdown Syntax
Heading 1# Title
Heading 2## Section
Bold**text**
Italic*text*
Strikethrough~~text~~
Inline code`code`
Code block```lang ... ```
Unordered list- item
Ordered list1. item
Checkbox- [x] done
Link[text](url)
Image![alt](url)
Blockquote> text
Horizontal rule---
Table| col | col |
Inline math$formula$
Display math$$formula$$
Footnote[^1] / [^1]: text