MaisTools
Productivity/

Markdown Cheat Sheet

Quick Markdown reference with syntax, examples and preview side by side.

Markdown Cheat Sheet

Syntax, examples and preview

Headings

Heading H1

Level 1 heading, with one hash.

Syntax
# Heading 1
Preview

Heading 1

Heading H2

Level 2 heading, with two hashes.

Syntax
## Heading 2
Preview

Heading 2

Heading H3

Level 3 heading, with three hashes.

Syntax
### Heading 3
Preview

Heading 3

Headings H4 to H6

H4, H5 and H6 work the same way, with more hashes.

Syntax
#### Heading 4
##### Heading 5
###### Heading 6
Preview

Heading 4

Heading 5
Heading 6
Alternate syntax (setext)

Alternate syntax for H1 and H2 using underlines.

Syntax
Heading 1 alt
=============

Heading 2 alt
-------------
Preview

Heading 1 alt

Heading 2 alt

Emphasis

Bold

Bold text, using two asterisks or underscores.

Syntax
**bold text**
Preview

bold text

Italic

Italic text, using one asterisk or underscore.

Syntax
*italic text*
Preview

italic text

Bold and italic

Combine bold and italic with three asterisks.

Syntax
***bold and italic***
Preview

bold and italic

Strikethrough

Strikethrough text, with two tildes.

Syntax
~~strikethrough~~
Preview

strikethrough

Highlight

Highlighted text, with two equal signs.

Syntax
==highlighted==
Preview

highlighted

Subscript and superscript

Subscript with tildes, superscript with carets.

Syntax
H~2~O and X^2^
Preview

H2O and X2

Lists

Unordered list

Use hyphen, asterisk or plus to start each item.

Syntax
- Item one
- Item two
- Item three
Preview
  • Item one
  • Item two
  • Item three
Ordered list

Numbers followed by a period. The renderer renumbers if needed.

Syntax
1. First
2. Second
3. Third
Preview
  1. First
  2. Second
  3. Third
Nested list

Indent two spaces per level to nest sub-lists.

Syntax
- Parent
  - Child
    - Grandchild
Preview
  • Parent
    • Child
      • Grandchild
Task list

Use [x] for done and [ ] for pending.

Syntax
- [x] Done
- [ ] Pending
- [ ] Todo
Preview
  • Done
  • Pending
  • Todo

Links

Basic link

Text in square brackets, URL in parentheses.

Syntax
[MaisTools](https://maistools.com)
Preview
Link with tooltip

Add a label in quotes after the URL.

Syntax
[Hover me](https://maistools.com "Tooltip text")
Preview
Reference link

Define the URL once and reference it by identifier.

Syntax
[Reference link][ref]

[ref]: https://maistools.com
Auto link

Wrap the URL in angle brackets to make it clickable.

Syntax
<https://maistools.com>

Images

Image

Like a link, but preceded by an exclamation mark.

Syntax
![Alt text](https://placehold.co/120x60)
Preview

Alt text

Image with tooltip

Add a label in quotes for accessibility.

Syntax
![Alt](https://placehold.co/120x60 "Tooltip")
Preview

Alt

Linked image

Wrap the image in a link to make it clickable.

Syntax
[![Logo](https://placehold.co/120x60)](https://maistools.com)
Preview

Code

Inline code

Wrap short snippets in backticks.

Syntax
Inline `code` here.
Preview

Inline code here.

Code block

Three backticks on their own lines mark a block.

Syntax
```
code block
  with indentation
```
Preview
code block
  with indentation
Code block with language

Specify the language after the backticks for syntax highlight.

Syntax
```js
const x = 42;
console.log(x);
```
Preview
const x = 42;
console.log(x);

Quotes

Blockquote

Put a greater than sign at the start of each line.

Syntax
> A quote line.
> Another line.
Preview
A quote line.
Another line.
Nested quote

Use multiple greater than signs for nested quotes.

Syntax
> Outer quote
>
> > Nested quote
Preview
Outer quote
>
> Nested quote

Tables

Basic table

Header on the first row, separator on the second, data after.

Syntax
| Fruit  | Color  |
| ------ | ------ |
| Apple  | Red    |
| Banana | Yellow |
Preview
FruitColor
AppleRed
BananaYellow
Column alignment

Use colons in the separator to align left, center or right.

Syntax
| Left | Center | Right |
| :--- | :----: | ----: |
| a    | b      | c     |
Preview
LeftCenterRight
abc

Other

Horizontal rule

Three hyphens, asterisks or underscores on an empty line.

Syntax
Above

---

Below
Preview

Above


Below

Line break

Two trailing spaces force a line break.

Syntax
Line 1.  
Line 2.
Preview

Line 1.
Line 2.

Escape characters

Prefix a character with a backslash to keep it literal.

Syntax
Escape: \*not italic\* and \# not heading
Preview

Escape: *not italic* and # not heading

Footnote

Use [^id] in the text and [^id]: definition below.

Syntax
Footnote ref[^1]

[^1]: Footnote content.
Preview

Footnote ref1


  1. Footnote content.
Definition list

Term on a line, definitions prefixed with a colon.

Syntax
Term
: Definition one
: Definition two
Preview
Term
Definition one
Definition two