Jupyter Notebook Markdown Cheat Sheet

Copyable Markdown examples for Jupyter Notebook cells, LaTeX equations, tables, images, HTML, and data science notes

Jupyter supports standard Markdown plus LaTeX math and HTML. See our Markdown Cheat Sheet for basic syntax.

Copyable Jupyter Markdown Examples

Markdown cell with equation

Use double dollar signs for centered equations in Markdown cells.

## Model accuracy

The final score is calculated with:

$$
accuracy = \frac{correct}{total}
$$

Notebook results table

Markdown tables render well in Jupyter for quick experiment summaries.

| Model | Accuracy | Notes |
| --- | ---: | --- |
| Baseline | 82% | Logistic regression |
| Tuned | 91% | Random forest |

Image with a caption

Keep image files next to the notebook or use a relative path from the notebook location.

![Confusion matrix](confusion-matrix.png)

*Figure 1. Validation confusion matrix.*

Headings & Text Formatting

Headings

Section titles — use one # per level

# H1
## H2
### H3
#### H4

Bold

Double asterisks

**bold text**

Italic

Single asterisks or underscores

*italic text*

Bold + Italic

Triple asterisks

***bold and italic***

Strikethrough

Double tildes

~~struck through~~

Blockquote

Greater-than sign at line start

> Quoted note or citation

Horizontal Rule

Divider between sections

---

Lists

Bulleted List

Dash or asterisk, indent to nest

- Item one
- Item two
  - Nested item

Numbered List

Ordered steps

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

Task List

Checkboxes (JupyterLab & modern renderers)

- [x] Clean data
- [ ] Train model

Links & Images

Link

Inline hyperlink

[Jupyter docs](https://jupyter.org)

Image

Relative path from the notebook file

![Alt text](figure.png)

Image from URL

Remote image

![Logo](https://example.com/logo.png)

Attachment Image

Image embedded via drag-and-drop into the cell

![plot](attachment:plot.png)

Tables

Basic Table

Pipes and a dashed separator row

| Column A | Column B |
| --- | --- |
| value 1 | value 2 |

Aligned Columns

Colons control column alignment

| Left | Center | Right |
| :--- | :---: | ---: |
| a | b | c |

Code

Inline Code

Single backticks inside a sentence

Call `df.head()` to preview

Fenced Code Block

Syntax-highlighted, not executed

```python
import pandas as pd
df = pd.read_csv("data.csv")
```

Plain Code Block

No highlighting, keeps spacing

```
raw output or logs
```

LaTeX Math

Inline Math

Inline equations

$E = mc^2$

Display Math

Centered equations

$$\sum_{i=1}^{n} x_i$$

Fractions

Fraction notation

$\frac{a}{b}$

Greek Letters

Greek symbols

$\alpha, \beta, \gamma, \theta$

Subscript/Superscript

Sub and super

$x_i^2$ or $x_{i+1}^{n-1}$

Square Root

Roots

$\sqrt{x}$ or $\sqrt[n]{x}$

HTML in Markdown

Colored Text

Custom colors

<span style="color:red">Red text</span>

Centered Text

Center alignment

<center>Centered text</center>

Image Size

Sized images

<img src="img.png" width="300"/>

Line Break

Force line break

<br>

Advanced Formatting

Internal Link

Link to heading

[Link to section](#section-name)

Alert Box

Info boxes

<div class="alert alert-info">Info message</div>

Collapsible

Expandable section

<details><summary>Title</summary>Hidden content</details>

Magic Commands

%matplotlib inlineDisplay plots inline
%load_ext autoreloadEnable autoreload extension
%timeitTime a single statement
%%timeTime entire cell
%%writefile filenameWrite cell to file
%%bashRun cell as bash script
%%htmlRender cell as HTML
%%latexRender cell as LaTeX

Shareable Image Version

Prefer a picture? Save or share the Jupyter Notebook Markdown cheat sheet as a single image — handy for pinning in team chats, wikis, and study notes.

Jupyter Notebook Markdown cheat sheet infographic: cell shortcuts, headings, LaTeX equations, images, tables, code blocks, HTML, and magic commands with descriptionsDownload image (PNG)

Keyboard Shortcuts

Esc + MConvert cell to Markdown
Esc + YConvert cell to Code
Shift + EnterRun cell and select below
Ctrl + EnterRun cell
Esc + AInsert cell above
Esc + BInsert cell below
Esc + D, DDelete cell

Frequently Asked Questions

How do I make a Markdown cell in Jupyter Notebook?

Select the cell, press Esc, then press M. You can also use the cell type dropdown and choose Markdown.

Can Jupyter Markdown cells render LaTeX?

Yes. Use single dollar signs for inline math and double dollar signs for display equations. Jupyter renders them with MathJax.

Can I use HTML in Jupyter Markdown?

Yes, many HTML tags work inside Markdown cells, including span, div, img, details, and simple inline styles.

How do I add an image to a Jupyter Markdown cell?

Use standard Markdown image syntax: ![alt text](path/to/image.png) with a path relative to the notebook file, or a full URL. You can also drag an image into the cell (attachment:image.png) or use an HTML img tag to control the width.

How do I make a table in a Jupyter Markdown cell?

Use pipe syntax: put column names in the first row, a separator row of dashes (| --- | --- |) beneath it, then one row per line. Add colons to the separator row to align columns left, center, or right.

Is there a Jupyter Notebook Markdown cheat sheet PDF?

Yes — click the Download PDF button at the top of this page to get the full cheat sheet as a free PDF file, including the LaTeX, table, and magic command references. No signup required.

Does code in a Markdown cell run?

No. Fenced code blocks in Markdown cells are display-only with syntax highlighting. To execute code, put it in a code cell instead.

Related Cheat Sheets