Markdown Cheat Sheet: Every Syntax Element, With Examples

This is a working reference, not a theory lesson. Every syntax element below shows the exact code you type on the left and exactly what it looks like once it's rendered on the right — copy, paste, done. It covers everything in standard Markdown (CommonMark) plus the extras that GitHub, Slack, and most documentation tools support (GitHub Flavored Markdown, or GFM).

New to Markdown? The short version: type **text** for bold, # for a heading, - for a bullet, and [text](url) for a link. That covers 90% of everyday use. The rest of this page fills in everything else.

  • How to Open an MD File: Complete Markdown Viewer Guide
  • Quick reference table

    ElementSyntax
    Heading# H1 · ## H2 · ### H3
    Bold**text**
    Italic*text*
    Bold + italic***text***
    Strikethrough~~text~~
    Unordered list- item
    Ordered list1. item
    Task list- [x] done
    Link[text](url)
    Image![alt](url)
    Inline code`code`
    Code blockthree backticks + language
    Blockquote> text
    Table row| cell | cell |
    Horizontal rule---
    Line breaktwo trailing spaces, then Enter

    Headings

    Six levels, made with 1–6 hash symbols followed by a space. Always leave a blank line before and after a heading.

    Code

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

    Result

    Heading 1

    Heading 2

    Heading 3

    Rule of thumb: use exactly one H1 per document and don't skip levels (go H2 → H3, not H2 → H4).

    Bold, italic & strikethrough

    Code

    **bold text**
    *italic text*
    ***bold and italic***
    ~~strikethrough~~
    `inline code`

    Result

    bold text

    italic text

    bold and italic

    strikethrough

    inline code

    Underscores (_italic_, __bold__) work the same way as asterisks. Asterisks are the safer default since underscores can misbehave mid-word (snake_case_word won't italicize unexpectedly with asterisks).

    Lists

    Unordered

    Code

    - First item
    - Second item
      - Nested item
    - Third item

    Result

    • First item
    • Second item
      • Nested item
    • Third item

    Ordered

    Code

    1. First step
    2. Second step
    3. Third step

    Result

    1. First step
    2. Second step
    3. Third step

    Handy trick: you can type 1. for every single item and Markdown will auto-number them correctly — useful when you reorder items often and don't want to renumber by hand.

    Task lists (GitHub Flavored Markdown)

    Code

    - [x] Completed task
    - [ ] Still to do

    Result

    • ☑ Completed task
    • ☐ Still to do

    On GitHub, Discord, and similar platforms these render as clickable checkboxes.

    Code

    [Visit our tools](https://example.com)
    <https://example.com>

    For documents with lots of links, reference-style syntax keeps the body text clean:

    Code

    Check out [this guide][1].
    
    [1]: https://example.com/guide

    Result

    Check out this guide.

    Images

    Code

    ![Alt text describing the image](photo.jpg)

    Result

    A rendered image, labeled with its alt text for accessibility and SEO.

    Always fill in the alt text (the part in square brackets) — it's what screen readers announce and what search engines index, not just a fallback.

    Code & code blocks

    Single backticks for a short inline snippet, triple backticks for a multi-line block. Add a language name right after the opening backticks for syntax highlighting.

    Code

    ```python
    def greet(name):
        return f"Hello, {name}!"
    ```

    Result

    def greet(name):
        return f"Hello, {name}!"

    Tables

    Code

    | Plan | Price |
    |------|-------|
    | Free | $0    |
    | Pro  | $9    |

    Result

    PlanPrice
    Free$0
    Pro$9

    Control alignment with colons in the separator row: :--- left, :---: center, ---: right. The pipes don't need to line up visually in your source — markdown only cares that they're present.

    Blockquotes

    Code

    > A quoted line of text,
    > continued on the next line.

    Result

    A quoted line of text, continued on the next line.

    Nest a second blockquote by doubling the arrow: >> nested quote.

    Horizontal rules

    Code

    ---

    Result


    *** and ___ work identically. Leave a blank line above and below for reliable rendering.

    Line breaks & paragraphs

    A blank line always starts a new paragraph. To force a line break inside the same paragraph, end the line with two trailing spaces before pressing Enter, or insert <br> directly.

    Escaping characters

    Put a backslash in front of any character that would otherwise trigger Markdown formatting:

    Code

    \*Not italic\*
    \# Not a heading

    Result

    *Not italic*
    # Not a heading

    Common mistakes

    • Forgetting the space after # or -. #Heading stays plain text; # Heading renders correctly.
    • No blank line around a block element. Lists, headings, and code blocks often fail to render if they're jammed directly against surrounding text.
    • Mixing list markers inconsistently. Switching between - and * mid-list can split it into two separate lists in some processors.
    • Missing the header-separator row in tables. A table needs both a header row and the --- row under it, or it won't render as a table at all.

    Want to see your own Markdown rendered instead of copying examples? Paste or upload a file into our free online viewer.

    Open the Free Markdown Viewer →

    FAQ

    What's the difference between Markdown and GitHub Flavored Markdown?

    Standard Markdown (CommonMark) covers headings, emphasis, lists, links, images, and code. GitHub Flavored Markdown (GFM) adds extras on top of that — task lists, tables, strikethrough, and automatic URL linking. Most modern tools support GFM, not just plain CommonMark.

    Do I need a blank line before a list or heading?

    In most processors, yes — a list or heading placed directly against the previous line of text can fail to render correctly. Adding a blank line above and below block elements is the safest habit.

    Can I use HTML inside Markdown?

    Yes, for anything Markdown can't express natively — most processors allow raw HTML tags like <br>, <details>, or <kbd> mixed directly into Markdown text.

    Why isn't my table rendering?

    Check for the separator row directly under the header (the line of dashes) and make sure every row has the same number of pipe-separated columns.

    Asterisks or underscores for bold and italic — does it matter?

    Both work in standard Markdown. Asterisks are generally the safer choice because underscores can trigger unexpectedly inside words that contain underscores, like variable or file names.