Skip to content
Markdown to PDF

Reference

Markdown cheat sheet

A complete Markdown cheat sheet with live examples: headings, lists, links, images, tables, task lists, footnotes, math, Mermaid diagrams, page breaks and more. Every example opens in the editor with one click.

Basic syntax

The original Markdown elements — supported by every Markdown app.

Headings

Try it
# Heading 1
## Heading 2
### Heading 3

Heading 1

Heading 2

Heading 3

Emphasis

Try it
**Bold**, *italic* and ***both***.
Use `inline code` for code.

Bold, italic and both. Use inline code for code.

Paragraphs and line breaks

Try it
First paragraph.

Second paragraph,\
with a line break.

First paragraph.

Second paragraph,
with a line break.

Leave a blank line between paragraphs. End a line with two spaces (or a backslash) for a line break.

Links

Try it
[Markdown to PDF](https://mdtopdfonline.com)

<https://example.com>

Images

Try it
![Markdown mark](/icon-192.png)

Markdown mark

Bulleted lists

Try it
- One
- Two
  - Nested
- Three
  • One
  • Two
    • Nested
  • Three

Numbered lists

Try it
1. First
2. Second
3. Third
  1. First
  2. Second
  3. Third

Blockquotes

Try it
> Markdown is intended to be as easy-to-read
> and easy-to-write as is feasible.

Markdown is intended to be as easy-to-read and easy-to-write as is feasible.

Code blocks

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

Add a language after the backticks for syntax highlighting.

Horizontal rule

Try it
Above

---

Below

Above


Below

Extended syntax (GitHub-flavoured)

Widely supported extensions from GitHub Flavored Markdown and friends.

Tables

Try it
| Left | Center | Right |
| :--- | :---: | ---: |
| a | b | c |
| 1 | 2 | 3 |
Left Center Right
a b c
1 2 3

Colons set column alignment.

Task lists

Try it
- [x] Write the draft
- [ ] Review
- [ ] Export to PDF

Strikethrough

Try it
~~This was a mistake.~~

This was a mistake.

Footnotes

Try it
Here is a claim.[^1]

[^1]: And here is the source.

Here is a claim.[1]


  1. And here is the source. ↩︎

Alerts (callouts)

Try it
> [!NOTE]
> Useful information.

> [!WARNING]
> Be careful here.

NOTE

Useful information.

WARNING

Be careful here.

Highlight, subscript, superscript

Try it
==Highlighted== text, H~2~O and x^2^.

Highlighted text, H2O and x2.

Emoji shortcodes

Try it
Ship it :rocket: :tada: :white_check_mark:

Ship it 🚀 🎉 ✅

Raw HTML

Try it
<kbd>Ctrl</kbd> + <kbd>P</kbd>

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

Hidden content.

</details>

Ctrl + P

Click to expand

Hidden content.

Safe HTML is kept; scripts are removed.

Math

LaTeX math rendered with KaTeX. Dollar signs and LaTeX-style delimiters both work.

Inline math

Try it
Euler’s identity: $e^{i\pi} + 1 = 0$, or \(a^2 + b^2 = c^2\).

Euler’s identity: eiπ+1=0e^{i\pi} + 1 = 0, or a2+b2=c2a^2 + b^2 = c^2.

Display math

Try it
$$
\sum_{k=1}^{n} k = \frac{n(n+1)}{2}
$$

∑k=1nk=n(n+1)2\sum_{k=1}^{n} k = \frac{n(n+1)}{2}

Matrices

Try it
$$
\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}
$$

(1234)\begin{pmatrix} 1 & 2 \\ 3 & 4 \end{pmatrix}

Diagrams

Mermaid code blocks turn text into flowcharts, sequence diagrams, Gantt charts and more.

Flowchart

Try it
```mermaid
flowchart LR
  A[Draft] --> B{Review}
  B -- OK --> C[Publish]
  B -- Changes --> A
```

Diagrams render live in the editor — press “Try it”.

Sequence diagram

Try it
```mermaid
sequenceDiagram
  Alice->>Bob: Hello!
  Bob-->>Alice: Hi!
```

Diagrams render live in the editor — press “Try it”.

PDF layout

Extras that control how your document is laid out when exported to PDF.

Page break

Try it
End of chapter one.

\newpage

# Chapter two

End of chapter one.

Chapter two

Also: \pagebreak or <!-- pagebreak -->.

Table of contents

Try it
[toc]

## Introduction
## Method
## Results

Introduction

Method

Results

Generated from your headings, with clickable links.

Front matter

Try it
---
title: Annual Report
author: Jane Doe
date: 2026-10-02
pdf:
  theme: academic
  toc: true
  cover: true
---

# Introduction

Front matter isn’t printed — it configures the document. Try it to see the cover page.

Sets the title, cover page details and per-document PDF settings.

Turn your Markdown into a PDF.

Everything on this page works in the free editor — with themes, page numbers and a table of contents.

Open the editor