Markdown is the simplest way to format text without a word processor. Created by John Gruber in 2004, it uses plain-text symbols to create headings, bold text, links, tables, and more. Today, Markdown powers GitHub READMEs, documentation sites, note-taking apps like Obsidian and Notion, blogs, and technical writing everywhere.

This cheat sheet covers every Markdown syntax element you’ll need — with clear examples you can copy and paste.

Headings

Use # symbols to create headings. More # symbols = smaller heading.

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

Tip: Always put a space after the # symbol. #Heading won’t work in most parsers.

Text Formatting

Bold

**bold text**
__also bold__

Italic

*italic text*
_also italic_

Bold and Italic

***bold and italic***
___also works___
**_mixing styles_**

Strikethrough

~~deleted text~~

Inline Code

Use the `console.log()` function to debug.

Paragraphs and Line Breaks

Separate paragraphs with a blank line:

This is the first paragraph.

This is the second paragraph.

For a line break within a paragraph, end the line with two spaces or use <br>:

First line.  
Second line (same paragraph).
[Link text](https://example.com)
[Google](https://google.com "Google Homepage")
[Click here][1] to visit the site.

[1]: https://example.com "Example Site"
<https://example.com>
<email@example.com>

Images

![Alt text](image-url.png)
![Cat photo](https://example.com/cat.jpg "A cute cat")
[![Alt text](image.png)](https://example.com)

Lists

Unordered Lists

- Item one
- Item two
  - Nested item
  - Another nested item
- Item three

You can also use * or +:

* Item one
* Item two

+ Item one
+ Item two

Ordered Lists

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

Tip: Markdown auto-numbers ordered lists. You can even write all 1. and it will still number correctly:

1. First
1. Second
1. Third

Task Lists

- [x] Write the introduction
- [x] Add code examples
- [ ] Proofread the article
- [ ] Publish

Blockquotes

> This is a blockquote.

> Multi-line blockquote.
> Still the same quote.

> Nested blockquote:
> > This is nested.

Code

Inline Code

Run `npm install` to install dependencies.

Code Blocks

Use triple backticks with an optional language identifier:

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

Supported languages include: javascript, python, java, kotlin, html, css, bash, json, yaml, sql, c, cpp, rust, go, swift, ruby, php, typescript, and many more.

Indented Code Blocks

Indent with 4 spaces or 1 tab:

    function hello() {
      return "world";
    }

Tables

| Header 1 | Header 2 | Header 3 |
|----------|----------|----------|
| Row 1    | Data     | Data     |
| Row 2    | Data     | Data     |
| Row 3    | Data     | Data     |

Column Alignment

| Left Aligned | Center Aligned | Right Aligned |
|:-------------|:--------------:|--------------:|
| Left         | Center         | Right         |
| Text         | Text           | Text          |
  • :--- = left align
  • :---: = center align
  • ---: = right align

Horizontal Rules

Create a horizontal line with three or more dashes, asterisks, or underscores:

---
***
___

Extended Syntax

These features are supported by most modern Markdown parsers (including GitHub Flavored Markdown and MerMD):

Footnotes

Here's a sentence with a footnote.[^1]

[^1]: This is the footnote content.

Definition Lists

Term
: Definition of the term.

Another Term
: Another definition.

Emoji

That's great! :+1:
I love Markdown :heart:

Highlighting

==highlighted text==

Subscript and Superscript

H~2~O (subscript)
X^2^ (superscript)

Advanced: Mermaid Diagrams

Modern Markdown viewers like MerMD support Mermaid diagrams — create flowcharts, sequence diagrams, and more using text:

```mermaid
graph TD
    A[Start] --> B{Is it working?}
    B -->|Yes| C[Great!]
    B -->|No| D[Debug]
    D --> B
```

See our Mermaid Diagram Syntax Guide for a complete tutorial.

Advanced: Math Equations (KaTeX)

Write beautiful math equations using KaTeX syntax:

Inline math: $E = mc^2$

Display math:
$$\int_{0}^{\infty} e^{-x^2} \, dx = \frac{\sqrt{\pi}}{2}$$

See our KaTeX Math Guide for full documentation.

Best Practices

1. Use Consistent Formatting

Pick one style and stick with it:

  • Use **bold** not __bold__
  • Use - for unordered lists, not *
  • Use --- for horizontal rules

2. Add Blank Lines Around Elements

Always add blank lines before and after headings, code blocks, lists, and blockquotes:

Some paragraph text.

## New Section

- List item one
- List item two

Another paragraph.
<!-- Bad -->
Click [here](https://example.com) for more info.

<!-- Good -->
Read the [installation guide](https://example.com) for setup instructions.

4. Keep Lines Readable

Aim for lines under 80-120 characters. Use line breaks for long paragraphs in the source.

5. Use ATX-Style Headings

Always use # headings (ATX style), not underline headings (Setext style):

<!-- Preferred (ATX) -->
## My Heading

<!-- Avoid (Setext) -->
My Heading
----------

Viewing Markdown on Android

Writing Markdown is easy — but viewing it beautifully on mobile requires the right app. Most apps show raw text or basic formatting. MerMD renders everything:

  • ✅ Full CommonMark + GFM support
  • Syntax-highlighted code blocks (30+ languages)
  • Mermaid diagrams — flowcharts, sequence, Gantt, pie charts
  • KaTeX math — inline and display equations
  • Tables with proper formatting and alignment
  • Task lists with interactive checkboxes
  • Dark and light themes for comfortable reading
  • Cloud integration — Google Drive, OneDrive, Dropbox, GitHub

Quick Reference Table

ElementSyntaxExample
Heading# H1H1
Bold**text**text
Italic*text*text
Link[text](url)link
Image![alt](url)image
Code`code`code
Blockquote> text> text
Unordered List- item• item
Ordered List1. item1. item
Horizontal Rule------
Table| H | H |Table
Task List- [x] done☑ done
Strikethrough~~text~~text
Footnote[^1]Footnote

Preview Your Markdown on Android

Write Markdown anywhere, view it beautifully on Android. MerMD renders headings, tables, code, diagrams, and math — free on Google Play.

Download MerMD