MarkdownVerse LogoMarkdownVerse

Markdown Cheat Sheet — Complete Syntax Reference

This interactive reference guide outlines markdown formatting elements and syntax quirks. Toggle tabs to filter between basic CommonMark rules, extended GitHub Flavored Markdown (GFM) elements, and advanced nesting behaviors.

ElementMarkdown SyntaxOutput Preview
H1 Header
ATX Style: Must include a space after the hash character.
# Heading 1

Heading 1

H2 Header
ATX Style: Used for major document sections.
## Heading 2

Heading 2

H3 Header
ATX Style: Used for sub-sections.
### Heading 3

Heading 3

Setext H1
Alternative Setext Style: Underline text with any number of equal signs.
Heading 1 ===

Heading 1

Setext H2
Alternative Setext Style: Underline text with any number of hyphens.
Heading 2 ---

Heading 2

Bold Text
Surround text with double asterisks or double underscores.
**Bold Text**
Bold Text
Italic Text
Surround text with single asterisks or single underscores.
*Italic Text*
Italic Text
Bold & Italic
Combine styles by nesting three asterisks or underscores.
***Bold & Italic***
Bold & Italic
Unordered List
Create bulleted markdown lists. Start lines with a hyphen (-), asterisk (*), or plus (+).
- Item A - Item B
  • Item A
  • Item B
Ordered List
Create numbered markdown lists. Start lines with numbers followed by a period and a space.
1. First 2. Second
  1. First
  2. Second
Inline Link
Enclose link text in square brackets, followed by URL in parentheses.
[MarkdownVerse](https://www.markdownverse.space)
Embedded Image
Syntax resembles link, preceded by an exclamation mark.
![Logo](/favicon.ico "Title")
Logo
Inline Code
Wrap code keywords or expressions in backticks.
`const sum = a + b;`
const sum = a + b;
Blockquote
Start lines with a greater-than sign (>) followed by a space.
> Quote line > Continuation
Quote line
Continuation
Horizontal Line
Create a markdown horizontal line divider using three or more hyphens, asterisks, or underscores.
---

Markdown Comment
Insert markdown comments that remain invisible in the rendered HTML output.
<!-- comment -->
Line Break
Add two spaces at the end of the line, or end the line with a backslash (\).
Line one Line two
Line one
Line two
Ignore formatting
Escape markdown characters by placing a backslash before them.
\*Literal stars\*
*Literal stars*
GFM Table
GFM Extension: Pipes divide columns; separator dashes align content via colons.
| Col A | Col B | | :--- | ---: | | Left | Right |
Col ACol B
LeftRight
Fenced Code Block
Surround code with triple backticks or tildes, adding a language name.
```javascript const hello = "world"; ```
const hello = "world";
Task List (Todo)
GFM Extension: Square brackets with a space (unchecked) or x (checked).
- [ ] To do task - [x] Done task
  • To do task
  • Done task
Markdown Strikethrough
GFM Extension: Create a markdown strikethrough by surrounding text with double tildes.
~~Strikethrough text~~
Strikethrough text
Automatic Links
GFM parses raw URLs automatically. Use angle brackets for explicit styling.
<https://www.markdownverse.space>
GFM Footnotes
GFM Extension: Insert key superscript links referencing a bottom definition.
Statement.[^1] [^1]: Footnote details.

Statement.[1]

[1] Footnote details.
HTML Entities
Standard HTML named entity references are decoded as literal symbols.
&copy; &amp; &lt; &gt; &nbsp;
© < >  
Inline HTML block
Raw HTML works inside markdown. Standard markdown tags inside HTML blocks are ignored.
<div class="alert"> **bold inside HTML** </div>
**bold inside HTML**
GFM Alerts / Admonitions
GFM Extension: Specify alert banners using [!NOTE], [!TIP], [!WARNING], [!CAUTION].
> [!NOTE] > This is an alert.
NOTE: This is an alert.
Anchor Links
Calculated link path to document headings: lowercase, spaces replaced with dashes.
[Heading Text](#heading-text)
Code Fences in List
Opening and closing code fences must be indented by 2 to 5 spaces under list.
- Item A ```javascript let x = 10; ```
  • Item A
    let x = 10;
Indented Code in List
Requires a blank line before, plus 6 spaces of indentation (2 for item + 4 for code).
- Item A let x = 10;
  • Item A
    let x = 10;
Numbered List Fence
Indent fences by 3 spaces to avoid breaking auto-numbering inside list items.
1. First ```javascript console.log("A"); ```
  1. First
    console.log("A");
Intraword Formatting
GFM blocks mid-word underscore formatting but processes asterisks.
word_underscore_no_format word*asterisk_format*
word_underscore_no_format
wordasterisk_format
Nested Blockquote
Use double characters (>> ) to indicate nested quotes.
> First level > > Second level

First level

Second level
Reference Link Def
Allows clean separation of links from paragraphs; parsed case-insensitively.
[text][ref] [ref]: https://domain.com "Title"
Autolink Escape
Escaping autolinks or wrapping them in code spans prevents link creation.
`https://example.com` or \<https://domain.com\>
https://example.com or <https://domain.com>

1. Understanding CommonMark and GFM Specifications

Markdown is a popular plain-text formatting syntax created by John Gruber in 2004. It serves to simplify content writing by eliminating standard HTML tag nesting. Because early implementations lacked a strict parsing standard, output consistency became a persistent issue. This led to the creation of CommonMark, a standardized specification that defines markdown parsing behaviors.

GitHub Flavored Markdown (GFM) is a strict superset of CommonMark. GFM introduces elements designed specifically for developer workspaces, such as task list checkboxes, inline tables, automatic link formatting, and code highlighting blocks. Understanding the differences between standard CommonMark and GFM helps prevent rendering failures across various static generators and blog layouts.

2. Heading Syntax and Automated Anchoring

Headings organize technical content and establish clean visual hierarchies. Markdown supports two heading styles: ATX and Setext. ATX headings utilize one to six hash characters (#) at the start of a line to represent levels H1 to H6. The hash characters must be followed by a space before the heading text, which prevents parsing errors.

Setext headings create levels H1 and H2 by underlining text lines with equal signs (=) or hyphens (-). While Setext headings remain readable in plain text, ATX headings are generally preferred due to their clear structure and flexibility.

Many modern markdown platforms generate anchor links for headings automatically. The parser processes heading text by converting characters to lowercase, replacing spaces with hyphens, and dropping punctuation marks. For example, a heading like ### Custom GFM Elements! resolves to the anchor id #custom-gfm-elements.

# Level 1 Heading
## Level 2 Heading
### Level 3 Heading

Setext Level 1 Heading
======================

Setext Level 2 Heading
----------------------

3. List Nesting Rules and Fenced Code Blocks

Lists organize items sequentially (ordered) or non-sequentially (unordered). Unordered lists use hyphens, asterisks, or plus signs. Ordered lists use numbers followed by periods or parentheses. GFM introduces task lists, which represent checkbox widgets through square brackets containing a space [ ] or the letter [x].

Nesting complex blocks inside lists requires strict attention to indentation. To place a fenced code block inside a bullet list item, align the code block opening fence with the list text column. This alignment typically requires 2 to 5 spaces of indentation.

For ordered lists, aligning fenced code blocks requires 3 spaces of indentation to prevent breaking the automatic numbering order. If you prefer indented code blocks instead of fenced fences, insert a blank line before the block and indent the lines by at least 6 spaces.

- Standard List Item
  - Nested List Item
  ```javascript
  // Indented 2 spaces to align with text
  console.log("Nested block");
  ```

1. First Ordered Item
   ```javascript
   // Indented 3 spaces to preserve numbering
   console.log("Numbered block");
   ```

GFM tables allow structured data layouts without manual HTML table formatting. Columns are separated using pipe characters (|). The header separator row uses hyphens (-) to divide headings from cells. You can align text inside columns using colons (:): prefixing the hyphens aligns text left, appending aligns text right, and placing colons on both sides center-aligns the text.

Links connect related pages or external resources. Standard links place anchor text in square brackets and URLs in parentheses. When dealing with long URLs or complex structures, reference links keep paragraphs clean. Reference links reference a label declared elsewhere in the document, which allows text files to remain uncluttered.

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

Read the [License text][license-key] file.

[license-key]: https://domain.com/license.txt "License Info"

5. Blockquotes and Custom GFM Alerts

Blockquotes highlight external sources or specific callouts. Starting a line with a greater-than sign (>) formats it as a blockquote block. You can nest blockquotes by adding multiple greater-than signs (e.g. > >).

GFM introduced alert block structures, commonly called admonitions. These are formatted as blockquotes where the first line specifies the alert type in square brackets, such as [!NOTE], [!TIP], or [!WARNING]. Alert boxes are useful for documentation layouts as they render with custom colors and icons in GFM-compatible browsers.

> Standard blockquote line.
>
>> Nested blockquote line.

> [!NOTE]
> This is a GFM alert node pointing to useful resources.

> [!WARNING]
> This is an alert warning the reader about critical steps.

Frequently Asked Questions

Who invented markdown?
John Gruber, in collaboration with Aaron Swartz, invented markdown in 2004. They designed it as a lightweight plain text formatting language that compiles directly to HTML, making technical writing and web publishing highly readable in its raw state.
What is a markdown file?
A markdown file (typically ending in a .md or .markdown extension) is a plain text file structured with simple typography tags. Unlike proprietary DOCX files, you can read and open an md file using any basic text reader or code editor.
In markdown how to link to external websites or local files?
To write a link in markdown, place the anchor text inside square brackets followed immediately by the URL path or file path in parentheses, like [text](url). If you want to link to a local documentation file, write the relative path [Readme](README.md) as the URL target.
In markdown how to bold text elements?
To make text bold in markdown, wrap your words inside double asterisks (**) or double underscores (__). For example, writing **bold text** instructs the parser to render the words inside standard HTML <strong> tags.
In markdown how to underline key phrases?
Standard markdown does not include a native tag to underline text to avoid confusion with hyperlinks. However, since HTML is supported, you can underline text by using the inline HTML tags <u>underline this</u>, or wrap it in a custom style attribute.
In markdown how to indent code paragraphs or text blocks?
To indent a block of text, you can start the lines with a greater-than sign (>) to format it as a blockquote. If you need to indent code blocks inside list items, indent the text by 4 spaces, or use a tab key to trigger an indented code block.
How do I create a markdown list?
To write an unordered markdown list, start each line with a hyphen (-), asterisk (*), or plus (+). For ordered lists, start each line with numbers followed by periods (like 1. and 2.). You must always place a space after the list marker for it to parse correctly.
How do I create a markdown table?
To design a markdown table, separate columns using pipe characters (|) and separate headers from data rows using dashed lines (-). You can align text left, right, or center by placing colons (:) inside the dashed separator row.
How do I insert a markdown image inside a document?
To insert a markdown image, write an exclamation mark (!) followed by the alt description text in square brackets, and the image file path or web URL in parentheses, like ![Alt Description](/favicon.ico).