Markdown Cheatsheet
Complete syntax reference for Markdown and GitHub-Flavored Markdown (GFM). Every element with an example.
Headers
# H1 ## H2 ### H3 #### H4
Bold & Italic
**Bold** *Italic* ***Bold italic*** ~~Strikethrough~~
Links & Images
[Link text](https://example.com) 
Lists
- Unordered item - Another item - Nested item 1. First 2. Second 3. Third
Blockquote
> This is a blockquote. > It can span multiple lines.
Code
`inline code` ```js const x = 42; console.log(x); ```
Table
| Name | Age | |-------|-----| | Alice | 28 | | Bob | 34 |
Task list
- [x] Done - [ ] Not done - [ ] Also pending
Horizontal rule
---
Escape
\*literal asterisk\* \# not a header
Quick reference card
# Header 1→ H1## Header 2→ H2**text**→ Bold*text*→ Italic~~text~~→ Strikethrough`code`→ Inline code[text](url)→ Link→ Image> text→ Blockquote---→ Horizontal rule- item→ Unordered list1. item→ Ordered list- [x] done→ Task list```lang\n...\n```→ Code block| col | col |→ TableHow Markdown syntax works
Markdown converts plain text conventions into HTML. When a Markdown processor reads your text, it scans for specific patterns — a line starting with # becomes an <h1>, text wrapped in ** becomes <strong>, and so on. The beauty of Markdown is that the raw source is readable as plain text even before it is rendered — unlike raw HTML which is cluttered with tags.
The original Markdown specification by John Gruber (2004) left many edge cases undefined, which led to different processors handling ambiguous syntax differently. CommonMark (2014) resolved these ambiguities with a formal specification. Most modern tools — GitHub, VS Code, Notion, Obsidian — use CommonMark as the base, with optional extensions for additional features like tables and task lists.
Tips for avoiding common mistakes
Blank lines matter. Markdown uses blank lines to separate blocks. Two paragraphs need a blank line between them. A list item immediately after a paragraph (with no blank line) will often be rendered as a continuation of the paragraph, not a list. If your list is not rendering correctly, add a blank line before the first item.
Indentation for nested lists. Nested list items need to be indented by at least two spaces (or one tab) relative to the parent. Different processors require different indent depths — GitHub uses 2 spaces, some tools require 4. If your nested items are not rendering as nested, try increasing the indent.
Escaping Markdown characters. To use a * or # literally without triggering formatting, prefix it with a backslash: \* renders as *. The escapable characters are: \ ` * _ { } [ ] < > ( ) # + - . ! |
Code blocks preserve formatting. Content inside backtick code blocks or fenced code blocks is not processed as Markdown — it is displayed exactly as typed. This makes code blocks essential for showing Markdown syntax itself, as in this cheatsheet.
Try it live
Paste any Markdown and see it rendered instantly in the live previewer.
Open Markdown Previewer →Frequently asked questions
How do I make text bold in Markdown?
Wrap text in double asterisks: **bold text** or double underscores: __bold text__. Both produce <strong> in HTML.
How do I create a link in Markdown?
Use [link text](URL) syntax. Example: [QuickToolsHub](https://quicktoolshub.org) renders as a clickable link. For a link with a title: [text](URL 'title here').
How do I add a code block in Markdown?
For inline code, wrap in backticks: `code here`. For a fenced code block, use triple backticks on their own lines: ```language\ncode here\n```. Replace 'language' with js, python, bash, etc. for syntax highlighting.
How do I create a table in Markdown?
Use pipes and dashes: | Header 1 | Header 2 | on the first row, then | --- | --- | on the second row (separator), then data rows. Align columns with :---: (center), ---: (right), or :--- (left) in the separator row.
What is the difference between Markdown and GitHub-Flavored Markdown?
Standard Markdown (CommonMark) covers basic formatting. GitHub-Flavored Markdown (GFM) adds: tables, fenced code blocks with language hints, task lists (- [x] done), strikethrough (~~text~~), autolinks, and mention syntax (@username). Most Markdown processors support GFM extensions.
How do I add an image in Markdown?
Use  — the same as a link but with an exclamation mark prefix. Example: . The alt text appears if the image fails to load and is important for accessibility and SEO.