Markdown Cheat Sheet

A complete reference for GitHub Flavored Markdown (GFM) syntax — the dialect used by GitHub, VS Code, Notion, and most markdown tools.

Headings

Use # symbols for headings. One # for H1, two for H2, up to six for H6.

SyntaxDescription
# Heading 1Largest heading — use once per page for the title
## Heading 2Section heading
### Heading 3Sub-section heading
#### Heading 4Minor heading
##### Heading 5Small heading
###### Heading 6Smallest heading
# Project Title

## Overview

### Installation

#### Step 1: Install dependencies

Text Formatting

SyntaxDescription
**bold text**Bold
__bold text__Bold (alternative)
*italic text*Italic
_italic text_Italic (alternative)
***bold and italic***Bold and italic
~~strikethrough~~Strikethrough
`inline code`Inline code
<mark>highlight</mark>Highlighted text (HTML)
text<br>new lineLine break within a paragraph
---Horizontal rule
This is **bold**, this is *italic*, and this is ***both***.

~~This text is crossed out.~~

Use `console.log()` for debugging.

Lists

Use -, *, or + for unordered lists. Indent with 2 spaces to nest.

SyntaxDescription
- itemUnordered list item
* itemUnordered list item (alternative)
1. itemOrdered list item
- nestedNested list item (2-space indent)
- Apples
- Bananas
  - Cavendish
  - Plantain
- Cherries

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

Code

Wrap inline code in backticks. Use triple backticks for fenced code blocks, optionally with a language for syntax highlighting.

SyntaxDescription
`code`Inline code
```\ncode\n```Fenced code block
```js\ncode\n```Code block with syntax highlighting
codeIndented code block (4 spaces)
Run `npm install` to get started.

```typescript
function greet(name: string): string {
  return `Hello, ${name}!`;
}

console.log(greet("World"));
```

```bash
npm install
npm run dev
```

Common language identifiers: js, ts, python, bash, sql, json, yaml, html, css, markdown

Tables

Tables are a GFM extension. Use pipes | to separate columns. The second row defines column alignment.

SyntaxDescription
| Col | Col |Table row
|-----|-----|Separator row (required)
|:----|Left-align column
|----:|Right-align column
|:---:|Center-align column
| Name       | Role        | Status   |
|:-----------|:------------|:--------:|
| Alice      | Engineer    | Active   |
| Bob        | Designer    | Active   |
| Carol      | PM          | Away     |

| Item     | Price   |
|:---------|--------:|
| Coffee   |   $3.50 |
| Sandwich |   $8.00 |
| Total    |  $11.50 |

Blockquotes

Use > to create blockquotes. Nest them with multiple > characters.

> This is a blockquote.
> It can span multiple lines.

> **Note:** Blockquotes can contain other markdown.
> - Like lists
> - And **bold text**

> Outer quote
>> Nested quote
>>> Deeply nested

Task Lists

Task lists (checkboxes) are a GFM extension. Use - [ ] for unchecked and - [x] for checked.

- [x] Set up project structure
- [x] Write initial documentation
- [ ] Implement authentication
- [ ] Write tests
- [ ] Deploy to production

Misc

SyntaxDescription
---Horizontal rule (also *** or ___)
\*escaped\*Escape special characters with backslash
<!-- comment -->HTML comment (not rendered)
[^1]Footnote reference
[^1]: textFootnote definition
==highlight==Highlighted text (some parsers)
~subscript~Subscript (some parsers)
^superscript^Superscript (some parsers)

Special characters that need escaping: \ ` * _ { } [ ] ( ) # + - . !

Diagrams (Mermaid)

Mermaid diagrams render as live SVG charts. Wrap diagram code in a fenced code block with the mermaid language tag:

```mermaid
flowchart LR
    A[Start] --> B{Decision}
    B -->|Yes| C[Do it]
    B -->|No| D[Skip]
    C --> E[Done]
    D --> E
```

Renders as:

SyntaxDescription
flowchart LR / TDLeft-right or top-down flowchart
sequenceDiagramSequence / interaction diagram
erDiagramEntity-relationship diagram
ganttGantt chart / project timeline
classDiagramUML class diagram

Math formulas (KaTeX)

Math formulas are written in LaTeX syntax. Use $...$ for inline math and $$...$$ for block (display) math:

Inline: $E = mc^2$ and $\\sum_{i=1}^{n} x_i$

Block:
$$
\\int_{-\\infty}^{\\infty} e^{-x^2}\\,dx = \\sqrt{\\pi}
$$

Block formula renders as:

SyntaxDescription
$E = mc^2$Inline math — renders within a sentence
$$...$$Block math — centred on its own line
\frac{a}{b}Fraction
\sqrt{x}Square root
\sum_{i=1}^{n}Summation with limits
\int_{a}^{b}Integral with limits

PDF export — themes & typography

The Markdown to PDF toollets you control how your document looks before exporting. Here's a full reference of every option.

Themes

Light

Clean white background, charcoal text. Professional default for most documents.

Dark

Dark background with light text and indigo headings. Great for technical docs and developer output.

Sepia

Warm cream background and amber headings. Easy on the eyes for long-form writing.

Minimal

All borders and decorations stripped away. Maximum whitespace for a clean, distraction-free look.

Ocean

Deep navy background with cyan headings. Bold and modern for presentations and reports.

Font families

FontTypeBest for
System SansSans-serif · SystemDefault OS font stack — crisp at any size, no download needed
InterSans-serif · GoogleModern UI sans designed for screens — very readable at small sizes
RobotoSans-serif · GoogleClean and neutral — great for documentation
Open SansSans-serif · GoogleHumanist, highly readable for dense body text
LatoSans-serif · GoogleWarm geometric feel — suits business reports
GeorgiaSerif · SystemClassic editorial serif, excellent readability for long text
MerriweatherSerif · GoogleHigh-contrast serif built for screen readability
Playfair DisplaySerif · GoogleHigh-contrast display serif — impactful headings and covers
JetBrains MonoMonospace · GoogleDeveloper-focused code font with ligatures — great for code-first docs

Style controls

Font size

Range: 10 – 20 px

Default: 14 px

Controls the base body text size. Headings scale proportionally.

Line spacing

Range: 1.2 – 2.5

Default: 1.6

Sets the line-height multiplier. Higher values improve readability for dense text.

Margins

Range: None / Narrow / Normal / Wide

Default: Normal

Controls page padding. Wide (65 px / 100 px) suits printed reports; None suits tight screen layouts.

See the full walkthrough in the Markdown to PDF Guide.

✏️

Practice in the live editor

Try any of this syntax in our free browser-based markdown editor with live preview, formatting toolbar, and auto-save.