Skip to content
Free · No signup · Instant

Jupyter Markdown Guide

Complete Jupyter Notebook markdown reference. Cell formatting, LaTeX math, HTML, and magic commands explained.

LaTeX mathHTML supportCell typesFree forever

Quick Reference

All Jupyter markdown syntax at a glance.

FeatureSyntax
Heading H1# Heading
Heading H2## Heading
Bold**bold**
Italic*italic*
Bullet list- item
Numbered list1. item
Code (inline)`code`
Code block```python code ```
Math inline$x^2 + y^2$
Math block$$\int_0^\infty f(x)dx$$
Image![alt](url)
HTML<div style="color:red">text</div>

Cell Types

Jupyter has three cell types: Code, Markdown, and Raw. Switching between them changes how the cell content is interpreted.

Markdown Cell

Press M in command mode to convert a cell to markdown

README.md

Section Title

This is formatted text with emphasis and inline code.

  • Item 1
  • Item 2

Code Cell

Press Y in command mode to convert to a code cell — executes on Shift+Enter

README.md
import pandas as pd\ndf = pd.read_csv('data.csv')\ndf.head()

Keyboard Shortcuts for Cell Types

Command mode shortcuts (press Escape first, then the key)

README.md
M → Convert to Markdown cell\nY → Convert to Code cell\nR → Convert to Raw cell\n\nShift+Enter → Run cell and move to next\nCtrl+Enter → Run cell in place\nAlt+Enter → Run cell and insert new below

Math & LaTeX

Jupyter renders LaTeX math via MathJax in markdown cells. Both inline and display (block) math are supported.

Inline Math

Wrap LaTeX in single dollar signs for inline rendering

README.md

The formula x² + y² = r² defines a circle of radius r.

Display Math Block

Double dollar signs render math centered on its own line

README.md
∫₀^∞ f(x) dx = limn→∞ Σk=1n f(x_k) Δx

Common LaTeX Symbols

Frequently used math symbols in Jupyter notebooks

README.md
Greek: α, β, γ, σ, μ\nSets: ∈, ⊂, ∪, ∩, ∅\nOps: Σ, Π, ∫, ∂, ∇\nArrow: →, ⇒, ⟺

HTML in Markdown Cells

Jupyter passes HTML through in markdown cells, enabling custom styles, colors, and alignment that plain markdown can't do.

Colored and Styled Text

Use inline HTML to apply colors and custom styles

README.md
Warning: This step is irreversible.
⚠️ Important note goes here.

Centered Content and Custom Tables

HTML alignment and table attributes work in Jupyter markdown cells

README.md

Centered Heading

Centered paragraph text.

FeatureSupported
Math
HTML

Images & Media

Embed images using standard markdown syntax or HTML for size control. Both local paths and URLs work.

Markdown Image

Standard markdown image syntax — uses the full available width

README.md
[Image: Scatter plot of results]
./figures/scatter.png

HTML img Tag for Size Control

Use an HTML img tag to set width or height explicitly

README.md
🖼 Image rendered at specified width (400px)
Use width attribute to control display size

Magic Commands vs Markdown

Magic commands are IPython directives that go in code cells. They are not markdown but are often confused with it.

Line Magics (%)

Single % applies to one line — must be in a code cell

README.md
%matplotlib inline # show plots in notebook\n%timeit sum(range(1000)) # benchmark expression\n%who # list all variables\n%load_ext autoreload # auto-reload modules

Cell Magics (%%) — Render as HTML or LaTeX

Double %% applies to the entire cell — changes how it is interpreted

README.md
%%html\n

HTML cell

\n\n%%latex\n\\begin{"{"}equation{"}"}\n E = mc^2\n\\end{"{"}equation{"}"}

Markdown vs Magic — Key Difference

Markdown goes in markdown cells; magics go in code cells

README.md
Markdown cell
Standard markdown
LaTeX math
HTML tags
Code cell
Python/R/Julia code
% line magics
%% cell magics

Unsupported in Jupyter Markdown

Features that do not work in standard Jupyter markdown cells.

Interactive checkboxes

Use ipywidgets for interactive elements in notebooks

Anchor links between cells

Cells don't have stable anchors — use headings for navigation

Pro Tips

1Press M to switch to markdown

In command mode (press Escape first), press M to convert the selected cell to a markdown cell. Press Y to switch back to a code cell.

2Double-click to edit markdown

A rendered markdown cell shows formatted output. Double-click it to enter edit mode and see the raw markdown source.

3Shift+Enter to render and advance

Press Shift+Enter to render the current markdown cell and move to the next cell. Ctrl+Enter renders in place without moving.

4Use HTML <details> for collapsible sections

Jupyter renders HTML in markdown cells, so you can create collapsible sections using the native <details> and <summary> tags.

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

Hidden content here.

</details>

Frequently asked questions

Everything you need to know.

1

What types of cells does Jupyter support?

Jupyter has three cell types: Code cells run executable code (Python, R, Julia, etc.) and display output below. Markdown cells render formatted text, math, and HTML. Raw cells pass content through unprocessed — useful for nbconvert templates. Switch between them with M (markdown), Y (code), or R (raw) in command mode.

Need to convert your notebook output?

Export markdown to a clean HTML page — perfect for sharing Jupyter analysis without requiring Python.