Markdown cheat sheet

39 Markdown elements with the source and the rendered result side by side. Copy any of them, or insert them from the Markdown editor.

Basic syntax

The original 2004 syntax. Every Markdown app renders these.

  • Heading

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

    Heading 1

    Heading 2

    Heading 3

    Put a space after the # and a blank line before and after the heading. Up to six levels.

  • Alternate heading

    Heading 1
    =========
    
    Heading 2
    ---------

    Heading 1

    Heading 2

    Any number of = or - under the text; only levels 1 and 2.

  • Bold

    **bold text**

    bold text

    Use asterisks inside a word: Love**is**bold.

  • Italic

    *italic text*

    italic text

    Inside a word use asterisks, not underscores: A*cat*meow.

  • Bold and italic

    ***really important***

    really important

  • Blockquote

    > A quote.
    >
    > Second paragraph, nested:
    >> Deeper.

    A quote.

    Second paragraph, nested:

    Deeper.

    Blank lines before and after. Headings, lists and code work inside.

  • Ordered list

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

    Numbers need not be in order; the first one sets the start.

  • Unordered list

    - First item
    - Second item
      - Nested item
    • First item
    • Second item
      • Nested item

    Use one marker (-, * or +) per list. Indent two spaces to nest.

  • Code

    Run `npm install` first.

    Run npm install first.

    Backticks inside code: ``a `literal` backtick``.

  • Code block

        indented four spaces
        is a code block
    indented four spaces
    is a code block
    
  • Horizontal rule

    ---

    Blank lines around it, or it becomes a heading.

  • Link

    [sdev tools](https://www.sdev.in/tools "Browser tools")

    The title in quotes is optional. Replace spaces in a URL with %20.

  • Autolink

    <https://www.sdev.in>
  • Image

    ![sdev logo](/pwa-192.png)

    sdev logo

    Wrap it in a link to make it clickable: [![alt](img.png)](https://…).

  • Line break

    Two spaces at the end  
    break the line.<br>So does the br tag.

    Two spaces at the end
    break the line.
    So does the br tag.

    Trailing spaces are easy to miss; <br> is the visible option. A backslash at the end works in CommonMark.

  • Escaping

    \* Not a bullet
    
    1968\. Not a list
    
    \# Not a heading

    * Not a bullet

    1968. Not a list

    # Not a heading

    A backslash shows the next punctuation mark literally.

Extended syntax

Added by CommonMark, GitHub Flavored Markdown and others. Most apps render most of them.

  • Table

    | Syntax | Description |
    | --- | --- |
    | Header | Title |
    | Paragraph | Text |
    SyntaxDescription
    HeaderTitle
    ParagraphText

    Cell widths need not line up. Show a pipe inside a cell with &#124;.

  • Table alignment

    | Left | Center | Right |
    | :--- | :---: | ---: |
    | a | b | c |
    LeftCenterRight
    abc
  • Fenced code block

    ```json
    {
      "name": "sdev",
      "tools": 60
    }
    ```
    {
      "name": "sdev",
      "tools": 60
    }
    

    Three backticks or tildes, no indenting. The language after the fence enables highlighting where supported.

  • Footnote

    A claim with a footnote.[^1]
    
    [^1]: The footnote text.

    A claim with a footnote.1


    1. The footnote text. ↩

    Identifiers can be words; footnotes are numbered in order of first use.

  • Heading ID

    ### My heading {#custom-id}
    
    Jump to [the heading](#custom-id).

    My heading

    Jump to the heading.

  • Definition list

    First term
    : Definition of the first term.
    
    Second term
    : One definition.
    : Another definition.
    First term
    Definition of the first term.
    Second term
    One definition.
    Another definition.
  • Strikethrough

    ~~The world is flat.~~ We now know it is round.

    The world is flat. We now know it is round.

  • Task list

    - [x] Write the press release
    - [ ] Update the website
    - [ ] Contact the media
    • Write the press release
    • Update the website
    • Contact the media
  • Emoji

    Gone camping! :tent: Be back soon. :joy:

    Gone camping! ⛺ Be back soon. 😂

    Shortcode names vary between apps; pasting the emoji itself always works.

  • Highlight

    I need to highlight these ==very important words==.

    I need to highlight these very important words.

  • Subscript

    H~2~O

    H2O

    Some apps use a single tilde for strikethrough instead.

  • Superscript

    X^2^

    X2

  • Reference link

    See the [tools page][tools] and the [docs].
    
    [tools]: https://www.sdev.in/tools
    [docs]: https://www.sdev.in/courses "Courses"

    See the tools page and the docs.

    Keeps long URLs out of the sentence. Definitions can sit anywhere in the document.

  • Plain URL

    Linked: https://www.sdev.in
    
    Not linked: `https://www.sdev.in`

    Linked: https://www.sdev.in

    Not linked: https://www.sdev.in

    Bare URLs become links; wrap one in backticks to keep it as text.

Hacks syntax

Plain HTML and entities for what Markdown has no syntax for.

  • Underline

    Some words <ins>will be underlined</ins>.

    Some words will be underlined.

  • Keyboard key

    Press <kbd>Ctrl</kbd> + <kbd>S</kbd> to save.

    Press Ctrl + S to save.

  • Indent

    &nbsp;&nbsp;&nbsp;&nbsp;An indented first line.

        An indented first line.

    Markdown has no tab indent; non-breaking spaces are the last resort.

  • Comment

    Visible paragraph.
    
    [This comment is hidden.]: #
    
    Another visible paragraph.

    Visible paragraph.

    Another visible paragraph.

    Blank lines before and after the comment line.

  • Admonition

    > :warning: **Warning:** Do not push the big red button.
    > :bulb: **Tip:** Blockquotes with an emoji and bold stand in for callouts.

    ⚠️ Warning: Do not push the big red button. 💡 Tip: Blockquotes with an emoji and bold stand in for callouts.

  • Image caption

    ![sdev logo](/pwa-192.png)
    *The sdev logo, as a caption in italics.*

    sdev logo The sdev logo, as a caption in italics.

  • Symbols

    Copy &copy; 2026 &middot; 25&deg;C &middot; &rarr; &larr; &pi; &euro;

    Copy © 2026 · 25°C · → ← π €

    Any HTML character entity works, or paste the symbol itself.

  • Line break in a table

    | Syntax | Description |
    | --- | --- |
    | Paragraph | First line.<br>Second line. |
    SyntaxDescription
    ParagraphFirst line.
    Second line.
  • Table of contents

    - [Install](#install)
    - [Usage](#usage)
    
    ## Install
    
    ## Usage

    Install

    Usage

    Heading ids are made from the heading text: lower case, spaces to hyphens.

Specifications

How to use the cheat sheet

  1. Find the element

    Jump to Basic, Extended or Hacks. Each row shows the name, the Markdown source and the rendered result side by side, with a note where apps differ.

  2. Copy or insert

    Copy the source with the button under the name, or use the Insert button on the same sheet under the Markdown editor to drop it at the cursor.

  3. Learn the rest

    New to Markdown? The lessons take twenty minutes and the quiz checks what stuck; this sheet is step three, for looking things up later.

Good to know

  • Space after the # in headings, blank lines around headings, lists, quotes, rules and code blocks. Processors disagree when they touch.
  • Emphasis inside a word needs asterisks: Love**is**bold. Underscores in the middle of a word are left alone by many processors.
  • Do not indent paragraphs. Four spaces or a tab at the start of a line is a code block.
  • One bullet character per list. Switching between -, * and + mid-list starts a new list in some processors.
  • A line that starts with a number and a period becomes a list. Write 1968\. to keep it as text.
  • Spaces in a URL break the link: use %20, or put the whole URL in angle brackets.
  • Only attribute-less inline tags such as <br>, <sub>, <kbd> and <ins> pass through here. For centred or coloured text, image sizes and link targets, switch to the HTML tab.
  • Markdown inside HTML blocks is not processed. Keep the two on separate lines with a blank line between.

Questions people ask

What is the difference between basic and extended syntax?

Basic is the syntax from John Gruber's original 2004 design: headings, emphasis, lists, quotes, code, links, images and rules. Every Markdown app renders it. Extended elements such as tables, fenced code, footnotes, task lists and strikethrough were added later by CommonMark, GitHub Flavored Markdown and other processors, and support varies by app.

Will these render in my app?

Basic syntax, yes. For extended syntax check the note under the element and test in the app you write for; GitHub, GitLab, Obsidian, Notion and static site generators each pick a slightly different set. Hacks rely on the app allowing inline HTML.

How do I use a snippet?

Copy it with the button next to its name, or open the Markdown editor, where the same sheet sits under the editor with an Insert button that drops the element at the cursor.

Where is the full specification?

The links at the bottom go to the original syntax description, the CommonMark specification and the GitHub Flavored Markdown specification, which are the sources this sheet follows.