How to Convert a Google Colab Notebook to PDF (Without Cut-Off Code)
Save a Google Colab notebook as a clean PDF: download the .ipynb and convert it, or use Colab's Print option. Includes the nbconvert method inside Colab.
Quick answer: In Colab choose File → Download → Download .ipynb, then open the downloaded file in ipynbtopdfscanner and press Download PDF. This keeps all code and outputs and avoids the cut-off text you often get from Colab’s File → Print.
Method 1: Download the .ipynb and convert it (recommended)
- In Google Colab, open your notebook and run all cells so the outputs are saved (Runtime → Run all).
- Choose File → Download → Download .ipynb.
- Open ipynbtopdfscanner and choose the downloaded file.
- Press Download PDF (or Share on a phone).
Charts, tables, math and error messages are kept. Long code lines wrap instead of being cut off.
Method 2: Colab’s File → Print
Colab has File → Print, which opens the browser’s print dialog where you can choose “Save as PDF”. It works for short notebooks, but long code, wide DataFrames and scrolled outputs are often cut off or hidden.
Method 3: Run nbconvert inside Colab
You can install LaTeX in the Colab machine and run nbconvert there. It works but takes several minutes each time:
!apt-get install -y texlive-xetex texlive-fonts-recommended texlive-plain-generic pandoc
!jupyter nbconvert --to pdf "/content/drive/MyDrive/Colab Notebooks/notebook.ipynb"
The notebook must be in a folder Colab can read, such as your mounted Google Drive.
Skip the setup: convert your notebook to PDF in your browser, free and private.
Open the converterFrequently asked questions
Why is my Colab PDF missing outputs?
Outputs are only saved if the cells were run before you downloaded the notebook. Run all cells, then download the .ipynb again.
Can I convert Colab to PDF on my phone?
Yes. Download the .ipynb from Colab on your phone, open ipynbtopdfscanner in the browser and choose the file from Downloads.