Markdown cheat sheet, with live examples
This markdown cheat sheet puts every piece of syntax on one page, from headings and lists to tables, maths and diagrams. Open the interactive version to edit the examples and see the result instantly.
Open the interactive cheat sheet
Markdown syntax at a glance
| Element | Markdown |
|---|---|
| Heading | # Heading 1 |
| Bold | **bold text** |
| Italic | *italic text* |
| Strikethrough | ~~struck text~~ |
| Inline code | `code` |
| Link | [link text](https://example.com) |
| Image |  |
| Bulleted list | - First item |
| Numbered list | 1. First |
| Task list | - [x] Done |
| Quote | > A quoted line |
| Divider | --- |
| Code block | ```js |
| Table | | Name | Age | |
| Inline maths | $E = mc^2$ |
| Display maths | $$ |
| Diagram | ```mermaid |
A quick markdown guide
Markdown is a way of formatting plain text with a handful of symbols. A line starting with # becomes a heading, text between two asterisks becomes bold, and a line starting with a dash becomes a bullet point. Because the symbols are simple, a markdown file stays readable even before it is formatted, which is why it is used for READMEs, notes, documentation and chat apps.
The core markdown syntax covers headings, emphasis, lists, links, images, quotes and code. GitHub Flavored Markdown, the version most tools follow today, adds tables, task lists, strikethrough and fenced code blocks with a language name for syntax highlighting. Many editors, including this one, also render LaTeX maths between dollar signs and Mermaid diagrams in a mermaid code block.
The table below shows the markdown formatting for each element. The quickest way to learn is to try it: open the interactive cheat sheet, change an example and watch the preview update. When you are ready to write, the markdown editor has a toolbar for every element, and the table generator builds tables for you.
Markdown has a few rules that catch people out. A new paragraph needs a blank line before it, and a single line break inside a paragraph needs two spaces or a backslash at the end of the line. Nested list items need to be indented under their parent. Symbols you want to show literally, such as an asterisk, can be escaped with a backslash. Keep these in mind and most formatting problems disappear.
Every example on this page is standard syntax that works on GitHub and in most editors. Bookmark the page, or install the app, and the cheat sheet is one click away whenever you forget how a table or a task list is written.
When this markdown cheat sheet helps
- Writing a README for a GitHub or GitLab project.
- Formatting messages in apps that understand markdown, such as Discord and Slack.
- Taking structured notes in Obsidian, Notion or another markdown notes app.
- Writing documentation or blog posts for a static site generator.
- Formatting prompts and reading answers from AI chat tools, which use markdown heavily.
- Checking the syntax for less common elements like task lists, maths and diagrams.
Frequently asked questions
How do I make text bold in markdown?
Wrap it in two asterisks: **bold**. One asterisk on each side, *italic*, makes it italic.
How do I make a table in markdown?
Separate cells with pipes and put a row of dashes under the header: | Name | Age |, then | --- | --- |, then one row per line.
How do I add a line break?
Leave a blank line to start a new paragraph. For a line break inside a paragraph, end the line with two spaces or a backslash.
How do I write maths in markdown?
Put inline maths between single dollar signs, like $E = mc^2$, and a display equation between double dollar signs on their own lines.
How do I add a link or an image?
Write the link text in square brackets followed by the address in round brackets: [Digitum](https://digitum.marketing). An image is the same with an exclamation mark in front: .
How do I write a code block?
Put three backticks on the line before and after the code. Add the language name after the first set, such as ```python, to get syntax highlighting. For code inside a sentence, wrap it in single backticks.
Open in Digitum Markdown Viewer