Saving and Exporting Notebooks in Jupyter Notebook

Saving and Exporting Notebooks in Jupyter Notebook#

When working with Jupyter Notebooks, it’s important to know how to save your work properly and how to export your dynamic documents into different formats for sharing, presentation, or publication. Here are the main options you will use:

1. Saving as a Jupyter Notebook (.ipynb)#

  • This is the default file format for Jupyter Notebooks.

  • It preserves everything: your code, Markdown text, outputs (like plots and tables), and cell execution order.

  • The .ipynb file can be reopened and edited later in Jupyter or compatible tools.

  • Saving frequently is essential to avoid losing your progress.

  • You can save by clicking the save icon or pressing Ctrl + S on Windows and Cmd + S on Mac.

2. Exporting as HTML#

  • Exporting to HTML creates a static web page version of your notebook.

  • This version includes all outputs and formatting (code, text, images, plots) but is not editable.

  • HTML files are useful for sharing your work with others who don’t need to run or modify the code.

  • They can be easily viewed in any web browser without requiring Jupyter or Python.

  • To export, go to the menu: File > Save and Export Notebook as > HTML (.html).

3. Exporting as PDF#

  • Exporting as a PDF creates a document suitable for printing or formal sharing.

  • Like HTML, it’s a static snapshot of your notebook with all visible code, text, and outputs.

  • PDFs are widely accepted in academic and professional settings.

  • Export via File > Save and Export Notebook as > PDF via LaTeX (.pdf).