How to Convert .ipynb to PDF
Published on
Updated on

A .ipynb file is a Jupyter Notebook: JSON that bundles your code, outputs, charts, and markdown. A PDF flattens all of that into one portable document anyone can open, print, or attach — which is why notebooks usually get exported to PDF for reports, assignments, and reviews.
Quick answer
Pick the route that matches your setup:
- No install, one file right now: upload the notebook to RunCell's free online ipynb-to-PDF converter (opens in a new tab), check the preview, and click Generate PDF. It runs in your browser and needs no LaTeX.
- You use JupyterLab on your own machine: install the RunCell extension once with
pip install runcell. Every notebook toolbar then gets a RunCell menu with Export as PDF(.pdf), plus HTML and.pyexport. See the steps and a demo.
On the command line, nbconvert ships with Jupyter:
jupyter nbconvert --to pdf notebook.ipynbThat route renders through LaTeX. If you do not have a TeX distribution installed (the common xelatex not found error), use the Chromium-based exporter instead — no LaTeX required:
pip install "nbconvert[webpdf]"
jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynbVSCode, Jupyter, and Google Colab can also print to PDF. Pick the method that matches what you already have:
| Method | Install needed | Best for |
|---|---|---|
| Online converter (RunCell) | Nothing | One-off files, no local Python |
| RunCell JupyterLab extension | pip install runcell (once) | Local JupyterLab users; PDF, HTML, and .py from one menu |
nbconvert --to pdf | Jupyter + LaTeX | Clean, publication-style PDFs |
nbconvert --to webpdf | Jupyter + Chromium | Same, but no LaTeX setup |
| VSCode export | VSCode + Jupyter ext. | People already coding in VSCode |
| Browser / Jupyter print | Nothing extra | One-off, no-setup route |
| Google Colab print | Nothing (cloud) | Notebooks already in Colab |
- How to Use Pi Coding Agent 1.0: Install, Connect a Model, and Run Your First Task
- How to Use Laya: Classify Text in a pandas DataFrame with the Open-Source Jev Alternative
- Claude Code Reads AGENTS.md Now: Setup, Loading Modes, and Sharing One File with Codex, OpenCode, and Cursor
- How to View Deleted Reddit Posts (2026 Guide): 5 Ways That Still Work
- GPT Image 2.5: How to Use It, Flare vs Sunburst, and API Pricing
- How to Use DeepSeek Harness: Install, Set Up, and Run Your First Agent
- Runcell Science: An Open Source Alternative to Claude Science for Research Workflows
- How to Make Mac Not Sleep: Keep Codex, Claude Code, and AI Agents Running
- OpenClaw vs ZeroClaw vs Pi Agent vs Nanobot: Which AI Agent Stack Should You Choose in 2026?
- Can Claude Code Analyze Jupyter Notebooks for Data Science? What It Actually Does
- Claude Code Routines: Why AI Agent Cron Jobs Matter
- Claude Code Desktop Bypass Permissions: How to Enable It
- How to Build Two Python Agents with Google’s A2A Protocol - Step by Step Tutorial
- Top 10 growing data visualization libraries in Python in 2025
Method 1: Online converter (no install)
When you need one PDF and do not want to set anything up, an online converter handles the conversion in the browser.
RunCell's ipynb-to-PDF converter (opens in a new tab) is free and needs no sign-up:
- Drop your
.ipynbonto the page, or click Try Sample Notebook to test it first. - Check the preview.
- Click Generate PDF, then choose Save as PDF in the print dialog.
The standard Generate PDF path runs entirely in your browser, so the notebook is not uploaded.

Other general-purpose options include Vertopal and OnlineConvertFree. Avoid uploading notebooks that contain credentials, private data, or proprietary code to third-party sites.
Method 2: Export from JupyterLab with the RunCell extension
If you run Jupyter on your own machine and export notebooks more than once, this is the least-friction route. RunCell is a JupyterLab extension that adds an export menu to every notebook's toolbar. PDF, HTML, and .py are one click away, and none of them need LaTeX.
Install it once, then restart JupyterLab:
pip install runcell
jupyter labIt needs JupyterLab 4.4 or newer and Python 3.10+. To install with conda, uv, or the JupyterLab Extension Manager instead, see the RunCell install page (opens in a new tab).
To export a notebook to PDF:
- Open the
.ipynbin JupyterLab and run the cells whose outputs you want in the PDF. - Click the RunCell icon in the notebook toolbar, next to the cell-type dropdown.
- Choose Export as PDF(.pdf). When the browser's print dialog opens, set the destination to Save as PDF and save.
RunCell icon → Export as PDF(.pdf) → Save as PDF. Code, outputs, and charts carry over.
Export as HTML(.html) and Export as Python(.py) in the same menu download the file directly. Each export saves the notebook first, so the file matches what you see on screen.
Why it is the easiest local route:
- No LaTeX. The PDF comes from the browser's print engine, so the
xelatex not founderror cannot happen. - Your notebook stays with you. The conversion runs on your own Jupyter server and browser; nothing is uploaded to a third-party service.
- Three formats, one menu. PDF for reports, HTML for sharing,
.pyfor scripts.
You do not need a RunCell account to export. Signing in unlocks the extension's AI features, such as the Code Review item in the same menu, which asks RunCell's AI to review your notebook.
Method 3: nbconvert (the canonical way)
nbconvert is the official Jupyter export tool. The PDF exporter converts your notebook to LaTeX, then compiles it, so you need both Jupyter and a TeX distribution (TeX Live, MiKTeX, or MacTeX) plus Pandoc.
# one-time setup if you do not have them
pip install nbconvert
# install a LaTeX distribution + pandoc via your OS package manager
# convert
jupyter nbconvert --to pdf notebook.ipynbThis produces notebook.pdf in the same folder. It gives the most polished, print-ready result, but the LaTeX dependency is the part that trips most people up (see Troubleshooting).
No LaTeX? Use webpdf
The webpdf exporter renders the notebook with a headless Chromium browser instead of LaTeX, so you skip the entire TeX install:
pip install "nbconvert[webpdf]"
jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynbThe first run downloads a small Chromium build. After that, conversions are fast and the layout matches what you see in the browser.
HTML as a fallback
When both routes fail, export to HTML and print that page to PDF from your browser. It always works:
jupyter nbconvert --to html notebook.ipynbMethod 4: Export to PDF in VSCode
If you already edit notebooks in Visual Studio Code with the Jupyter extension:
- Open the
.ipynbfile in VSCode. - Click the
...(More Actions) menu at the top of the notebook. - Choose Export and select PDF.
VSCode uses nbconvert under the hood, so the same LaTeX dependency applies. If the PDF export errors out, export to HTML from the same menu and print that to PDF.
Method 5: Print to PDF (no install)
Every notebook environment can reach "Print", and every OS can print to PDF. This is the quickest path when you just need one file.
- Jupyter Notebook / JupyterLab:
File > Save and Export Notebook As… > HTML, open the HTML, thenCtrl/Cmd + P > Save as PDF. Classic Notebook also hasFile > Download as > PDF via LaTeX. - Any browser: with the notebook or its HTML open, press
Ctrl/Cmd + Pand choose Save as PDF as the destination.
The tradeoff: long cells can break awkwardly across pages, so review the output.
Method 6: Google Colab
If your notebook lives in Google Colab, you do not need anything installed locally:
- Open the notebook in Colab.
- Go to File > Print.
- In the print dialog, set the destination to Save as PDF.
Colab renders the page through the browser, so the result mirrors the on-screen layout.
Troubleshooting
nbconvert failed: xelatex not found / PDF creating failed
The PDF exporter needs LaTeX. Either install a TeX distribution (TeX Live, MiKTeX, MacTeX) and Pandoc, or switch to the no-LaTeX route:
jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynbIf you work in JupyterLab, the RunCell extension's Export as PDF(.pdf) skips LaTeX entirely — see Method 2.
nbconvert: command not found
nbconvert is not installed or not on your PATH. Install it and call it through Python to be safe:
pip install nbconvert
python -m jupyter nbconvert --to pdf notebook.ipynbPlots or wide tables get cut off
LaTeX page width is fixed. Reduce figure size in the notebook before export, or use --to webpdf / HTML print, which wrap content to the page more forgivingly.
Output is missing cells
Make sure the notebook is saved and all cells have run. nbconvert exports the saved state, not the live kernel, so re-run and save before converting.
FAQ
What is the command to convert ipynb to PDF?
Run jupyter nbconvert --to pdf notebook.ipynb. If you do not have LaTeX installed, use jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynb instead.
How do I convert ipynb to PDF without LaTeX?
Use the webpdf exporter (pip install "nbconvert[webpdf]" then --to webpdf), or export to HTML and print to PDF from your browser. RunCell's online converter and its JupyterLab extension also produce PDFs without a TeX installation.
Can I export a notebook to PDF directly inside JupyterLab?
Yes. Install the RunCell extension with pip install runcell and restart JupyterLab. Then click the RunCell icon in the notebook toolbar, choose Export as PDF(.pdf), and pick Save as PDF in the print dialog. No LaTeX is needed, and the same menu exports HTML and .py.
How do I convert ipynb to PDF in VSCode?
Open the notebook, click the ... menu at the top, choose Export, and select PDF. VSCode uses nbconvert, so install LaTeX or export to HTML if the PDF step fails.
How do I convert a Colab notebook to PDF?
In Google Colab, open the notebook and use File > Print, then set the destination to Save as PDF.
How do I convert ipynb to HTML instead?
See our guide on converting .ipynb to HTML.
Related Guides
- How to Convert .ipynb to HTML
- How to Start JupyterLab
- What is
__pycache__in Python - How to Run Python Scripts