Markdown Cheatsheet: Syntax, Formatting & Structure Quick Reference

Quick reference for Markdown: headings, lists, code, tables & more.

Page content

Markdown language is used in wikipedia and Hugo. It has support for headers, lists, font style modifications, images, codequotes and tables. Here I keep a short summary of markdown formatting.

markdown-file in the space This image above is profuced by Flux - text to image AI.

Markdown is a lightweight markup language that you can use to add formatting elements to plaintext text documents. This guide provides a comprehensive overview of the most commonly used Markdown syntax, helping you create well-structured and visually appealing documents.

This cheatsheet is part of the Documentation Tools in 2026: Markdown, LaTeX, PDF & Printing Workflows hub.

Markdown Headings (H1–H6)

Headings in Markdown are created using the hash symbol (#). The number of hashes before the heading text indicates the level of the heading.

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

Bold, Italic, and Emphasis

Markdown provides several ways to emphasize text. You can use asterisks (*) or underscores (_) for italics and double asterisks (**) or double underscores (__) for bold.

Italic

*Italic* or _italic_

Bold

**Bold** or __bold__

Bold and Italic

***Bold and italic*** or ___bold and italic___

Ordered and Unordered Lists

Markdown supports both ordered and unordered lists.

Unordered List

- Item 1
- Item 2
  - Subitem 1
  - Subitem 2

Ordered List

1. First item
2. Second item
   1. Subitem 1
   2. Subitem 2

You can create links by wrapping the link text in square brackets ([]) and then wrapping the URL in parentheses (()).

[Link Text](URL)

Example

Visit [Markdown Guide](https://www.markdownguide.org/) for more information.

Embedding Images

Images are added using an exclamation mark (!) followed by the alt text in square brackets and the image URL in parentheses.

![Alt Text](Image URL)

Example

![Markdown Logo](https://www.markdownguide.org/assets/images/markdown-logo.png)

Blockquotes and Nested Quotes

Blockquotes are created using the greater than symbol (>).

> This is a blockquote.

Nested Blockquotes

> This is the first level of quoting.
>> This is nested blockquote.

Inline Code and Fenced Code Blocks

You can add inline code by wrapping it in backticks (` ). For code blocks, use triple backticks (``` ) before and after the code.

Inline Code

Use `printf()` for printing text in C.

Code Blocks

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

More about codeblocks in markdown - see separate post: Using Markdown Code Blocks

Horizontal Rules (Dividers)

Horizontal rules are created using three or more dashes (—), asterisks (***), or underscores (___).

---

Tables

Tables in Markdown are created using pipes (|) and hyphens (-).

Example
| Header 1 | Header 2 |
|----------|----------|
| Cell 1   | Cell 2   |
| Cell 3   | Cell 4   |

For alignment options, multi-column formatting, and GFM-specific features, see the Tables in Markdown: Complete Guide.

Task Lists (Checkboxes)

Task lists are a special type of list that allows you to create checkboxes.

Example
- [x] Completed task
- [ ] Incomplete task

Strikethrough Text

Strikethrough text is created using double tildes (~~).

~~This is strikethrough text.~~

Text Highlighting

Highlighting text is not natively supported in Markdown, but some renderers support it using the == syntax.

Example

==This is highlighted text.==

Subscripts and Superscripts

Subscripts are created using a caret (^) before the text, and superscripts are created using a tilde (~) before the text.

Example

H~2~O is water.
E = mc^2

Math Equations (LaTeX Syntax)

Math equations can be added using LaTeX syntax within dollar signs ($).

Example

$$ E = mc^2 $$

Escaping Special Characters

To escape special characters, use a backslash ().

Example

\*Italic\* or \_italic\_

This comprehensive cheatsheet covers the essential Markdown syntax you need to create well-formatted documents. For more advanced features and customizations, refer to specific renderer documentation or additional resources. If you use Hugo, the Hugo Commands Cheat Sheet is a handy companion reference.

Markdown is also the default storage format for self-hosted wikis and knowledge systems. DokuWiki uses a Markdown-friendly plain-text approach for personal and team knowledge bases. For AI-assisted knowledge systems built on Markdown pages, LLM Wiki explains why the format’s portability and diffability make it the right foundation for compiled knowledge.

Subscribe

Get new posts on AI systems, Infrastructure, and AI engineering.