Markdown Syntax Cheatsheet

Markdown Cheat Sheet

A comprehensive guide to Markdown syntax with live examples and rendered outputs. Master both basic and extended Markdown features to create beautiful formatted text.

Rendered Output Style:
Basic Syntax
Extended Syntax

Quick Reference

Jump to any syntax category to get started quickly

Basic Syntax

(13 items)

Extended Syntax

(15 items)

Basic Syntax

Essential Markdown elements supported by all Markdown applications. These form the foundation of Markdown formatting and are universally compatible.

Inline Elements

Bold Text

inline
Explore

Make text bold using double asterisks or double underscores around the text.

Markdown Input

**This is bold text**
__This is also bold text__

Rendered Output

This is bold text
This is also bold text

💡 Tips

  • Use ** for better compatibility across applications
  • Avoid spaces between the asterisks and text
  • Can be combined with other inline elements

Italic Text

inline

Make text italic using single asterisks or single underscores around the text.

Markdown Input

*This is italic text*
_This is also italic text_

Rendered Output

This is italic text
This is also italic text

💡 Tips

  • Use * for better compatibility across applications
  • Avoid spaces between the asterisks and text
  • Can be combined with bold formatting

Inline Code

inline

Wrap a short code snippet or command in single backticks to display it as inline code.

Markdown Input

`const x = 42;`

Rendered Output

const x = 42;

💡 Tips

  • If the code contains a backtick, wrap with multiple backticks (e.g., `` `nested` ``).
  • Use inline code for short commands, filenames, or variable names without line breaks.

Block Elements

Headings

block

Create section headings of different levels using hash symbols (#). The number of hash symbols corresponds to the heading level.

Markdown Input

# Heading 1
## Heading 2
### Heading 3
#### Heading 4
##### Heading 5
###### Heading 6

Rendered Output

Heading 1

Heading 2

Heading 3

Heading 4

Heading 5
Heading 6

💡 Tips

  • Always put a space between the # and the heading text
  • For compatibility, add blank lines before and after headings
  • Alternative syntax: Use === under text for h1 and --- for h2

Paragraphs

block

Create paragraphs by separating text with one or more blank lines. Maintain consistent indentation for proper formatting.

Markdown Input

This is the first paragraph.

This is the second paragraph.

This is the third paragraph.

Rendered Output

This is the first paragraph.

This is the second paragraph.

This is the third paragraph.

💡 Tips

  • Don't indent paragraphs with spaces or tabs
  • Use blank lines to separate paragraphs
  • Avoid using non-breaking spaces for indentation

Blockquotes

block

Create blockquotes using the > symbol. Blockquotes can contain multiple paragraphs and nested content.

Markdown Input

> This is a blockquote
>
> It can span multiple paragraphs.
>
>> This is a nested blockquote.

Rendered Output

This is a blockquote

It can span multiple paragraphs.

This is a nested blockquote.

💡 Tips

  • Add a > before each paragraph in a blockquote
  • Blockquotes can contain other Markdown elements
  • Use multiple > symbols for nesting blockquotes

Lists (Unordered)

block

Create unordered lists using -, *, or + as bullet points. Nest items by indenting with spaces or tabs.

Markdown Input

- First item
- Second item
    - Nested item 1
    - Nested item 2
- Third item

Rendered Output

  • First item
  • Second item
    • Nested item 1
    • Nested item 2
  • Third item

💡 Tips

  • Use consistent symbols for list items at each level
  • Indent nested items with 4 spaces or 1 tab
  • You can mix different symbols for different levels

Lists (Ordered)

block

Create ordered lists using numbers followed by periods. The actual numbers don't matter - Markdown will order them correctly.

Markdown Input

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

Rendered Output

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

💡 Tips

  • Numbers don't have to be in order, but should start with 1
  • Indent nested items with 4 spaces or 1 tab
  • You can mix ordered and unordered lists

Code Blocks (Indented)

block

Create code blocks by indenting each line with 4 spaces or 1 tab.

Markdown Input

    function greet(name) {
        console.log("Hello, " + name);
    }

Rendered Output

function greet(name) {
    console.log("Hello, " + name);
}

💡 Tips

  • Indent every line of the code block with at least 4 spaces
  • Leave blank lines before and after the code block
  • No syntax highlighting available with this method

Fenced Code Blocks

block

Create code blocks with syntax highlighting using triple backticks. Specify the programming language after the opening backticks.

Markdown Input

```javascript
function greet(name) {
  console.log(`Hello, ${name}!`);
}
```

Rendered Output

function greet(name) {
console.log(`Hello, ${name}!`);
}

💡 Tips

  • Specify the language for syntax highlighting
  • Use indentation for better readability
  • Escape backticks within code blocks using different numbers of backticks

Images

block

Insert an image by using an exclamation mark followed by alt text in brackets and the URL in parentheses.

Markdown Input

![Example Image](https://github.githubassets.com/assets/GitHub-Logo-ee398b662d42.png "Optional Title")

Rendered Output

Example Image

💡 Tips

  • Alt text improves accessibility and SEO if the image cannot load.
  • For reference-style, define at bottom: ![Example][img1] ... [img1]: https://github.githubassets.com/assets/GitHub-Logo-ee398b662d42.png "Title".

Horizontal Rule

block

Create a visual separator by placing at least three hyphens (---), asterisks (***), or underscores (___) on a single line.

Markdown Input

---
***
___

Rendered Output




💡 Tips

  • At least three characters are required, but you can use more (e.g., ------).
  • Leave a blank line before and after for maximum compatibility.

Extended Syntax

Advanced Markdown features that enhance basic syntax with additional functionality. Support varies across different platforms and processors.

Inline Elements

Strikethrough

inline

Strike through text using double tildes (~) around the text.

Markdown Input

~~This text is crossed out~~

Rendered Output

This text is crossed out

Supported Platforms

GitHubGitLabDiscordRedditTyporaObsidian

💡 Tips

  • Supported by GitHub Flavored Markdown (GFM)
  • Not supported in all Markdown processors
  • Can be combined with other inline formatting

Highlight

inline

Highlight text using double equal signs (==) around the text.

Markdown Input

==This text is highlighted==

Rendered Output

This text is highlighted

Supported Platforms

ObsidianTyporaMark TextZettlr

💡 Tips

  • Not widely supported across all platforms
  • Alternative: use HTML <mark> tags directly
  • Some processors use different syntax like ^^ or ++

Subscript

inline

Create subscript text using tilde (~) around the text.

Markdown Input

H~2~O

Rendered Output

H2O

Supported Platforms

PandocMultiMarkdownTyporaObsidian

💡 Tips

  • Not supported in standard Markdown
  • Available in some extended processors
  • Alternative: use HTML <sub> tags

Superscript

inline

Create superscript text using caret (^) around the text.

Markdown Input

X^2^

Rendered Output

X2

Supported Platforms

PandocMultiMarkdownTyporaObsidian

💡 Tips

  • Not supported in standard Markdown
  • Available in some extended processors
  • Alternative: use HTML <sup> tags

Emoji

inline

Insert emojis using colon syntax with emoji shortcodes.

Markdown Input

:smile: :heart: :thumbsup:

Rendered Output

😄 ❤️ 👍

Supported Platforms

GitHubGitLabDiscordSlackNotionTypora

💡 Tips

  • Supported by GitHub, Discord, and many platforms
  • Shortcode names vary between platforms
  • Can also use Unicode emoji directly

Automatic URL Linking

inline

Automatically convert URLs and email addresses to clickable links.

Markdown Input

Visit https://tomarkdown.dev or email test@example.com

Rendered Output

Supported Platforms

GitHubGitLabDiscordRedditSlackTypora

💡 Tips

  • Part of GitHub Flavored Markdown (GFM)
  • Automatically detects URLs and email addresses
  • May conflict with other text in some cases

Block Elements

Tables

block

Create tables using pipes (|) to separate columns and hyphens (-) to separate headers from content.

Markdown Input

| Name    | Age | City     |
|---------|-----|----------|
| Alice   | 30  | New York |
| Bob     | 25  | London   |

Rendered Output

NameAgeCity
Alice30New York
Bob25London

Supported Platforms

GitHubGitLabDiscordRedditTyporaObsidianNotionMultiMarkdown

💡 Tips

  • Part of GitHub Flavored Markdown (GFM)
  • Use colons (:) in header separator for alignment
  • Outer pipes are optional

Task Lists

block

Create interactive checkboxes using list syntax with [ ] for unchecked and [x] for checked items.

Markdown Input

- [x] Completed task
- [ ] Incomplete task
- [ ] Another task

Rendered Output

  • Completed task
  • Incomplete task
  • Another task

Supported Platforms

GitHubGitLabObsidianTyporaNotionJoplin

💡 Tips

  • Part of GitHub Flavored Markdown (GFM)
  • Can be nested within other lists
  • Interactive on supported platforms

Footnotes

block

Create footnotes using [^identifier] for the reference and [^identifier]: for the definition.

Markdown Input

This text has a footnote[^1].

[^1]: This is the footnote content.

Rendered Output

This text has a footnote1.

  1. This is the footnote content.

Supported Platforms

PandocMultiMarkdownTyporaObsidianZettlrMkDocs

💡 Tips

  • Supported by many extended Markdown processors
  • Footnote definitions can be placed anywhere in the document
  • Identifiers can be numbers, words, or phrases

Definition Lists

block

Create definition lists using terms on one line and definitions indented on the next line.

Markdown Input

Term 1
:   Definition for term 1

Term 2
:   Definition for term 2
:   Another definition for term 2

Rendered Output

Term 1
Definition for term 1
Term 2
Definition for term 2
Another definition for term 2

Supported Platforms

PandocPHP Markdown ExtraMultiMarkdownKramdown

💡 Tips

  • Not widely supported across all platforms
  • Definitions must be indented with spaces or tabs
  • Multiple definitions per term are allowed

Admonitions/Callouts

block

Create highlighted boxes for notes, warnings, tips, etc. using special syntax.

Markdown Input

!!! note "Optional Title"
    This is a note admonition.

!!! warning
    This is a warning!

Rendered Output

Optional Title

This is a note admonition.

Warning

This is a warning!

Supported Platforms

MkDocsMaterial for MkDocsObsidianDocusaurusVuePress

💡 Tips

  • Syntax varies between processors (!!!, :::, > [!NOTE])
  • Common in documentation platforms like MkDocs
  • Types include note, warning, tip, info, danger

Math Expressions (LaTeX)

block

Render mathematical expressions using LaTeX syntax with dollar signs.

Markdown Input

Inline math: $E = mc^2$

Block math:
$
\sum_{i=1}^{n} x_i = x_1 + x_2 + \cdots + x_n
$

Rendered Output

Inline math: E=mc2E = mc^2


Block math:

i=1nxi=x1+x2++xnsum_{i=1}^{n} x_i = x_1 + x_2 + cdots + x_n

Supported Platforms

GitHubGitLabObsidianTyporaNotionJupyter NotebookMkDocs

💡 Tips

  • Requires MathJax or KaTeX for rendering
  • Single $ for inline, double $ for block
  • Backslash escaping may be needed

Collapsible Sections

block

Create expandable/collapsible content sections using HTML details and summary tags.

Markdown Input

<details>
<summary>Click to expand</summary>

This content is hidden by default.

- Item 1
- Item 2

</details>

Rendered Output

Click to expand

This content is hidden by default.

  • Item 1
  • Item 2

Supported Platforms

GitHubGitLabObsidianTyporaMost HTML-compatible renderers

💡 Tips

  • Uses HTML tags but Markdown content inside
  • Supported on GitHub and many platforms
  • Great for FAQ sections and long content

Keyboard Keys

block

Display keyboard shortcuts using <kbd> HTML tags.

Markdown Input

Press <kbd>Ctrl</kbd> + <kbd>C</kbd> to copy.

Rendered Output

Press Ctrl + C to copy.

Supported Platforms

GitHubGitLabMost HTML-compatible renderersObsidianTypora

💡 Tips

  • Pure HTML, not Markdown syntax
  • Widely supported for representing keyboard input
  • Can be styled with CSS for better appearance

Abbreviations

block

Define abbreviations that show full text on hover.

Markdown Input

The HTML specification is maintained by the W3C.

*[HTML]: HyperText Markup Language
*[W3C]: World Wide Web Consortium

Rendered Output

The HTML specification is maintained by the W3C.

Supported Platforms

PHP Markdown ExtraKramdownMultiMarkdownPandoc

💡 Tips

  • Not widely supported across all platforms
  • Definitions can be placed anywhere in the document
  • Shows tooltip on hover in supported renderers

Explore More Cheatsheets

Discover specialized Markdown guides for different platforms and use cases

25+ Formats

Discord Markdown

Discord-specific markdown formatting for chat and embeds

Explore Guide
30+ Elements

R Markdown

R Markdown syntax for data science and reporting

Explore Guide