Method using Google Colab only
- Download your .ipynb file
You can actually do it using only Google Colab. File -> Download .ipynb
- Reupload it so Colab can see it
Click on the Files icon on the far left:

Then Upload to session storage:

Select & upload your .ipynb file you just downloaded.
- Get your file's path
then obtain its path (you might need to hit the Refresh button before your file shows up):

- Conversion using %%shell
Then, just as in Julio's answer, execute in a Colab cell:
%%shell
jupyter nbconvert --to html /PATH/TO/YOUR/NOTEBOOKFILE.ipynb
The %%shell lets the interpreter know that the following script is interpreted as shell. Don't write anything before %%shell, use a distinct cell for this.
The form of /PATH/TO/YOUR/NOTEBOOKFILE.ipynb will be something like /content/lightaberration3.ipynb.
- Your file is ready
Might need to click Refresh again, but your notebook.html will appear in the files, so you can download it:

The great thing about this is that nothing python-related has to be installed on your computer, not conda, not pip, only a browser.
Answer from zabop on Stack Overflowpython - Convert ipynb notebook to HTML in Google Colab - Stack Overflow
python - Jupyter (IPython) notebook: Convert an HTML notebook to ipynb - Stack Overflow
python - How to convert IPython notebooks to PDF and HTML? - Stack Overflow
Comparing Qwen3.5 vs Gemma4 for Local Agentic Coding
Can I convert .ipynb to HTML online?
What is an IPYNB file?
How to convert IPYNB to HTML in Google Colab?
Videos
Method using Google Colab only
- Download your .ipynb file
You can actually do it using only Google Colab. File -> Download .ipynb
- Reupload it so Colab can see it
Click on the Files icon on the far left:

Then Upload to session storage:

Select & upload your .ipynb file you just downloaded.
- Get your file's path
then obtain its path (you might need to hit the Refresh button before your file shows up):

- Conversion using %%shell
Then, just as in Julio's answer, execute in a Colab cell:
%%shell
jupyter nbconvert --to html /PATH/TO/YOUR/NOTEBOOKFILE.ipynb
The %%shell lets the interpreter know that the following script is interpreted as shell. Don't write anything before %%shell, use a distinct cell for this.
The form of /PATH/TO/YOUR/NOTEBOOKFILE.ipynb will be something like /content/lightaberration3.ipynb.
- Your file is ready
Might need to click Refresh again, but your notebook.html will appear in the files, so you can download it:

The great thing about this is that nothing python-related has to be installed on your computer, not conda, not pip, only a browser.
Google Colab doesn't currently have such a feature as a built-in.
Your best route is to first download it through File > Download .ipynb and then use the standard tool for Jupyter Notebook conversion, nbconvert:
jupyter nbconvert --to html notebook.ipynb
If you use an Anaconda Python distribution, nbconvert is most likely already installed. If not, refer to what is described in their install instructions to be able to convert:
pip install nbconvert
# OR
conda install nbconvert
I recently used BeautifulSoup and JSON to convert html notebook to ipynb. the trick is to look at the JSON schema of a notebook and emulate that. The code selects only input code cells and markdown cells
here is my code
from bs4 import BeautifulSoup
import json
import urllib.request
url = 'http://nbviewer.jupyter.org/url/jakevdp.github.com/downloads/notebooks/XKCD_plots.ipynb'
response = urllib.request.urlopen(url)
# for local html file
# response = open("/Users/note/jupyter/notebook.html")
text = response.read()
soup = BeautifulSoup(text, 'lxml')
# see some of the html
print(soup.div)
dictionary = {'nbformat': 4, 'nbformat_minor': 1, 'cells': [], 'metadata': {}}
for d in soup.findAll("div"):
if 'class' in d.attrs.keys():
for clas in d.attrs["class"]:
if clas in ["text_cell_render", "input_area"]:
# code cell
if clas == "input_area":
cell = {}
cell['metadata'] = {}
cell['outputs'] = []
cell['source'] = [d.get_text()]
cell['execution_count'] = None
cell['cell_type'] = 'code'
dictionary['cells'].append(cell)
else:
cell = {}
cell['metadata'] = {}
cell['source'] = [d.decode_contents()]
cell['cell_type'] = 'markdown'
dictionary['cells'].append(cell)
open('notebook.ipynb', 'w').write(json.dumps(dictionary))
here is part of print(soup.div) output
div class="container">
<div class="navbar-header">
<button class="navbar-toggle collapsed" data-target=".navbar-collapse" data-toggle="collapse" type="button">
<span class="sr-only">Toggle navigation</span>
<i class="fa fa-bars"></i>
</button>
<a class="navbar-brand" href="/">
<img src="/static/img/nav_logo.svg?v=479cefe8d932fb14a67b93911b97d70f" width="159"/>
</a>
</div>
<div class="collapse navbar-collapse">
<ul class="nav navbar-nav navbar-right">
<li>
<a class="active" href="http://jupyter.org">JUPYTER</a>
</li>
<li>
<a href="/faq" title="FAQ">
<span>FAQ</span>
A screen shot of the resulting ipynb file, loaded on my local jupyter and after running all the cells

Note the best answer may need some modification of the tags for it to work in late 2022 and forward
I'm adding this as an answer to highlight comments I made below the nice upvoted Answer.
Note that the current version of the awesome highly upvoted one won't probably work as the HTML tags signaling the various cells has changed. If you happen to have a really old version of HTML made, it may work. However, most of you will have have newer made HTML and you need the new tags to be in the code to distinguish the cells.
See my comments below that highly-voted on post (you'll need to click on 'Show more comments' option at the bottom to reveal all the comments) for a link to a place here to get an active Jupyter session where you can run the code demo right in your browser, without needing to sign in, via MyBinder service with the updated version of the code with the current tags used. See the fist code cell here for a direct source of a static representation of the code. (You don't want the cell magic line that begins %%writefile, just copy everything in that cell below that line.) The tags being different affects a few lines of the original code.
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.
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.ipynbThis 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.
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
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.