How to Convert a Jupyter Notebook (.ipynb) to PDF: 4 Easy Ways
Four ways to convert a Jupyter notebook (.ipynb) to PDF: an online converter, JupyterLab export, nbconvert and browser print, with pros and cons of each.
Quick answer: The quickest way is to open the .ipynb file in a browser-based converter such as ipynbtopdfscanner and press Download PDF: no installation needed. If you prefer the command line, run jupyter nbconvert --to webpdf notebook.ipynb (needs pip install "nbconvert[webpdf]") or jupyter nbconvert --to pdf notebook.ipynb (needs LaTeX and pandoc).
Way 1: Online converter (no installation)
- Open ipynbtopdfscanner on your phone or computer.
- Choose your
.ipynbfile, or drag it onto the page. - Check the live page preview. Hide any cells you don’t need, and add your name if it’s an assignment.
- Press Download PDF.
The notebook is converted inside your browser and never uploaded. Long code lines wrap, wide tables shrink to fit, and nothing is split across two pages.
Way 2: Export from JupyterLab or Jupyter Notebook
- JupyterLab: File → Save and Export Notebook As → PDF (or WebPDF).
- Classic Notebook: File → Download as → PDF via LaTeX.
- VS Code: the “…” menu of the notebook → Export → PDF.
All of these call nbconvert behind the scenes, so they need the same tools as Way 3. Without them you get errors such as “xelatex not found”.
Way 3: The nbconvert command
WebPDF uses a headless Chromium browser and needs no LaTeX:
pip install "nbconvert[webpdf]"
jupyter nbconvert --to webpdf --allow-chromium-download notebook.ipynb
The classic PDF exporter goes through LaTeX, so it needs a TeX distribution (MiKTeX, MacTeX or TeX Live) and pandoc:
jupyter nbconvert --to pdf notebook.ipynb
Way 4: Print from the browser
Open the notebook in Jupyter and press Ctrl + P (Cmd + P on Mac), then choose “Save as PDF”. It is quick but often cuts off long code lines and wide tables, and can split images across pages.
Which way should you use?
| Method | Install needed | Long code & wide tables | Works on phone |
|---|---|---|---|
| Online converter (ipynbtopdfscanner) | None | Wrapped / shrunk to fit | Yes |
| nbconvert WebPDF | Python + Chromium | Often cut off | No |
| nbconvert PDF (LaTeX) | Python + LaTeX + pandoc | Long lines run off the page | No |
| Browser print | None | Often cut off | Partly |
Skip the setup: convert your notebook to PDF in your browser, free and private.
Open the converterFrequently asked questions
What is an .ipynb file?
An .ipynb file is a Jupyter Notebook: a JSON file that stores code cells, text (markdown) and the outputs such as tables and charts. It is used by Jupyter, JupyterLab, Google Colab, Kaggle and VS Code.
Can I convert ipynb to PDF without Jupyter installed?
Yes. A browser-based converter reads the .ipynb file directly, so you don’t need Jupyter, Python or LaTeX.