Also use --execute to get the output

jupyter nbconvert --execute --to html notebook.ipynb

This produces a notebook.html file.

The best practice is to keep the output out of the notebook for version control, see: Using IPython notebooks under version control

But then, if you don't pass --execute, the output won't be present in the HTML, see also: How to run an .ipynb Jupyter Notebook from terminal?

For an HTML fragment without header: How to export an IPython notebook to HTML for a blog post?

Tested in Jupyter 4.4.0.

Answer from Ciro Santilli OurBigBook.com on Stack Overflow
๐ŸŒ
nbconvert
nbconvert.readthedocs.io โ€บ en โ€บ latest โ€บ usage.html
Using as a command line tool โ€” nbconvert 7.17.1 documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ jupyter nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
nbconvert
nbconvert.readthedocs.io
nbconvert: Convert Notebooks to other formats โ€” nbconvert 7.17.1 documentation
Primarily, the nbconvert tool allows you to convert a Jupyter .ipynb notebook document file into another static format including HTML, LaTeX, PDF, Markdown, reStructuredText, and more.
Discussions

python - How to convert IPython notebooks to PDF and HTML? - Stack Overflow
I just upload the .ipynb file, choose PDF, and download it within seconds. No installations, no command line, no setup issues. It runs in the cloud, uses SSL encryption, and deletes files after 24 hours. If you want a quick and hassle-free solution, this site is the easiest option. 2026-02-26T08:04:45.92Z+00:00 ... Save this answer. ... Show activity on this post. Also pass the --execute flag to generate the output cells ยท jupyter nbconvert --execute --to html ... More on stackoverflow.com
๐ŸŒ stackoverflow.com
python - How to use nbconvert from Jupyter Notebook to HTML - Stack Overflow
And there are flavors to each format. For example, to get a barebones HTML (no CSS): jupyter nbconvert notebook.ipynb --to html --template basic More on stackoverflow.com
๐ŸŒ stackoverflow.com
Ploomber Convert: A free online tool to convert Jupyter notebooks to PDF
Cool. Formatting between Notebooks and their HTML version equivalent to say the least. Itโ€™s not good. One other native solution Iโ€™ve found on macOS is that safariโ€™s print to/save as pdf does get the 1:1 formatting and Iโ€™ve successfully used it in a hand-in. Page breaks are non existing which is a little awkward but can be handled. Hope to get opportunity soon to try this out. More on reddit.com
๐ŸŒ r/IPython
8
28
September 8, 2022
Exporting to HTML with ipywidgets/output rendered in document
I figured it out. jupyter nbconvert --to html --HTMLExporter.exclude_code_cell=True my_notebook.ipynb and jupyter nbconvert --to html --no-input my_notebook.ipynb are not equivalent. The former excludes code cells entirely, not just the code input, hence no output. The latter exports with code cells but removes the actual code input. More on reddit.com
๐ŸŒ r/JupyterNotebooks
9
4
December 13, 2020
Top answer
1 of 16
154

If you have LaTeX installed you can download as PDF directly from Jupyter notebook with File -> Download as -> PDF via LaTeX (.pdf). Otherwise follow these two steps.

  1. For HTML output, you should now use Jupyter in place of IPython and select File -> Download as -> HTML (.html) or run the following command:

     jupyter nbconvert --to html notebook.ipynb  
    

    This will convert the Jupyter document file notebook.ipynb into the html output format.

    Google Colaboratory is Google's free Jupyter notebook environment that requires no setup and runs entirely in the cloud. If you are using Google Colab the commands are the same, but Google Colab only lets you download .ipynb or .py formats.

  2. Convert the html file notebook.html into a pdf file called notebook.pdf. In Windows, macOS (brew install wkhtmltodf) or Linux, install wkhtmltopdf. wkhtmltopdf is a command line utility to convert html to pdf using WebKit. You can download wkhtmltopdf from the linked webpage, or in many Linux distros it can be found in their repositories.

     wkhtmltopdf notebook.html notebook.pdf   
    

Original (now almost obsolete) revision: Convert the IPython notebook file to html.

ipython nbconvert --to html notebook.ipynb

2 of 16
37

Also pass the --execute flag to generate the output cells

jupyter nbconvert --execute --to html notebook.ipynb
jupyter nbconvert --execute --to pdf notebook.ipynb

The best practice is to keep the output out of the notebook for version control, see: Using IPython notebooks under version control

But then, if you don't pass --execute, the output won't be present in the HTML, see also: How to run an .ipynb Jupyter Notebook from terminal?

For an HTML fragment without header: How to export an IPython notebook to HTML for a blog post?

Tested in Jupyter 4.4.0.

๐ŸŒ
IPython
ipython.org โ€บ ipython-doc โ€บ 2 โ€บ notebook โ€บ nbconvert.html
Converting notebooks to other formats โ€” IPython 2.4.2-maint documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ ipython nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
nbconvert
nbconvert.readthedocs.io โ€บ en โ€บ 4.2.0 โ€บ usage.html
Using as a command line tool โ€” nbconvert 4.2.0 documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ jupyter nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
IPython
ipython.org โ€บ ipython-doc โ€บ 3 โ€บ notebook โ€บ nbconvert.html
Converting notebooks to other formats โ€” IPython 3.2.1 documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ ipython nbconvert --to markdown notebook.ipynb --stdout
Find elsewhere
๐ŸŒ
TutorialsPoint
tutorialspoint.com โ€บ jupyter โ€บ jupyter_converting_notebooks.htm
Jupyter - Converting Notebooks
This will convert mynotebook.ipynb to the mynotebook.html. Other export format is specified with `--to` clause. Note that other options include ['asciidoc', 'custom', 'html', 'latex', 'markdown', 'notebook', 'pdf', 'python', 'rst', 'script', 'slides'] HTML includes 'basic' and 'full' templates. You can specify that in the command line as shown below โˆ’ ยท jupyter nbconvert --to html --template basic mynotebook.ipynb
๐ŸŒ
nbconvert
nbconvert.readthedocs.io โ€บ en โ€บ 5.2.1 โ€บ usage.html
Using as a command line tool โ€” nbconvert 5.2.1 documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ jupyter nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
Read the Docs
media.readthedocs.org โ€บ pdf โ€บ nbconvert โ€บ latest โ€บ nbconvert.pdf pdf
nbconvert Documentation Release 7.17.0 Jupyter Development Team Feb 25, 2026
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ jupyter nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
IPython
ipython.readthedocs.io โ€บ en โ€บ 3.x โ€บ notebook โ€บ nbconvert.html
Converting notebooks to other formats โ€” IPython 3.2.3 documentation
For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ ipython nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
PyPI
pypi.org โ€บ project โ€บ nbconvert
nbconvert
JavaScript is disabled in your browser. Please enable JavaScript to proceed ยท A required part of this site couldnโ€™t load. This may be due to a browser extension, network issues, or browser settings. Please check your connection, disable any ad blockers, or try using a different browser
๐ŸŒ
IPython
ipython.org โ€บ ipython-doc โ€บ 1 โ€บ interactive โ€บ nbconvert.html
Converting notebooks to other formats โ€” IPython 1.2.1: An Afternoon Hack documentation
September 23, 2015 - For simple single-file output, such as html, markdown, etc., the output may be sent to standard output with: $ ipython nbconvert --to markdown notebook.ipynb --stdout
๐ŸŒ
Runcell
runcell.dev โ€บ tool โ€บ ipynb-to-html
Jupyter to HTML Converter (.ipynb โ†’ .html) โ€” Free
Open this page and drop your IPYNB file into the upload area. Review the live preview, then copy the markup or download the HTML file. Prefer the terminal? Run jupyter nbconvert --to html your-notebook.ipynb in the notebook directory.
๐ŸŒ
GitHub
github.com โ€บ jupyter โ€บ nbconvert
GitHub - jupyter/nbconvert: Jupyter Notebook Conversion ยท GitHub
$ jupyter nbconvert --to <output format> <input notebook> where <output format> is the desired output format and <input notebook> is the filename of the Jupyter notebook. Convert Jupyter notebook file, mynotebook.ipynb, to HTML using:
Starred by 1.9K users
Forked by 608 users
Languages ย  Python 51.5% | Jupyter Notebook 37.9% | Jinja 10.3% | CSS 0.2% | Makefile 0.1% | Go Template 0.0%
๐ŸŒ
nbconvert
nbconvert.readthedocs.io โ€บ en โ€บ 5.6.1 โ€บ customizing.html
Customizing nbconvert โ€” nbconvert 5.6.1 documentation
Out of the box, nbconvert can be used to convert notebooks to plain Python files. For example, the following command converts the example.ipynb notebook to Python and prints out the result:
๐ŸŒ
Runcell Blog
runcell.dev โ€บ blog โ€บ nb-convert-tutorial
Jupyter nbconvert: Convert Notebooks to HTML, PDF & Python โ€“ Runcell Blog
Jupyter nbconvert lets you export .ipynb notebooks to HTML, PDF, Python scripts, Markdown, slides, and more โ€” directly from the command line.