Every notebook eventually needs an audience, and the audience rarely has Jupyter. You can send the .ipynb file and hope, or send a PDF that nobody can copy code out of, or print to PDF and hand over a page of broken figures. There is a third option that fits most of these situations better than either: export the notebook to HTML and put that page behind a link.
A link opens in a browser on any phone, tablet or locked-down work laptop. It keeps the code, the outputs and the plots, it does not need a Python install, and it can be updated by re-uploading one file. This guide covers the export, the checks worth doing before you share it, and how to host the result.
Why HTML is usually the right share format
An .ipynb is a working file. It assumes a kernel, an editor and the reader’s willingness to run things. A PDF is a finished document: fixed pages, no scrolling, no copyable code unless the exporter was careful.
HTML sits between them. The notebook renders as one long page with its code blocks, its stored outputs and its images, and the reader only needs a browser. For a code review, a portfolio piece, a class handout or a client preview, that is exactly the right amount of structure.
It is also the smallest step from the file you already have. No LaTeX, no Pandoc, no page-break decisions.
Step 1: export the notebook to standalone HTML
The standard route is nbconvert:
pip install nbconvert
jupyter nbconvert --to html --embed-images notebook.ipynb
--embed-images is the flag that matters. Without it, plot images are written to a sibling folder and the HTML points at them by relative path — fine on your laptop, broken the moment you upload only the .html file. With it, every image is inlined as base64 and the page is genuinely self-contained.
Two more flags are worth knowing:
# Hide the code, keep the outputs — useful for a stakeholder preview
jupyter nbconvert --to html --embed-images --no-input report.ipynb
# Use the classic template if the default Lab styling is too heavy
jupyter nbconvert --to html --embed-images --template classic report.ipynb
If you do not have Python available, or the notebook is client material you would rather not upload anywhere, the IPYNB to HTML converter does the same export in the browser: it reads the file locally, inlines the images, and gives you a single .html to download.
Either way, check that the result is one file. Open it from a folder that contains nothing else, with the network disconnected. If the styling or the plots disappear, the export was not standalone.
Step 2: read the page as your reader will
Export is mechanical; publishing is editorial. Before the link goes anywhere:
- Scroll the whole thing. Long DataFrames, ANSI colour codes and LaTeX that renders in Jupyter but not in the export all show up here.
- Check the top of the page. The browser tab title comes from the notebook’s first heading.
Untitled.ipynbas a page title looks like an accident. - Look for what should not be public. Stored outputs are part of the file, and they are easy to forget: API keys in a traceback, a customer name in a DataFrame, an internal URL in a printed log line. Clear outputs and re-run the cells you want to show, rather than trusting a notebook that has been open for three weeks.
- Check the file size. Base64 images inflate quickly. A notebook with forty high-resolution figures can pass 10 MB, which is slow to open on mobile and over the limit of several free hosts.
If the page is too heavy, the honest fix is fewer figures or smaller ones, not a different format. A 40 MB HTML page is worse for the reader than a 2 MB PDF.
Step 3: put the file online
Because the export is a single static HTML file, hosting it is the easy part. There is no runtime, no database and no build — any service that serves files will do, and several do it for free.
The options that come up most often:
- GitHub Pages if the notebook already lives in a repository and you want the page to update on every push. It costs a commit, a branch setting and a few minutes of build time.
- Netlify Drop if you want to drag a folder and get a URL. It works well for a site with assets, and needs an account once you want to keep or rename the deploy.
- A single-file host if the page is one
.htmland you want a link in the next ten seconds. Free HTML Host is built for exactly this: you paste the markup or drop the file, pick a name, and it is live atfreehtmlhost.com/your-namewith HTTPS and no build step. A free account lifts the per-site limit to 10 MB, which comfortably covers a notebook with inlined plots; guest uploads are capped at 3 MB and expire after seven days, so sign in if the link needs to survive.
Whichever you choose, the workflow after that is the same: re-export, re-upload, same URL. Nobody has to be told that the page changed.
A few practical notes on publishing notebook HTML:
- Assume the page is public. A guessed or shared URL is not access control. If the notebook contains anything you would not post on a company blog, redact it in the notebook before exporting.
- Keep the filename meaningful.
churn-model-report.htmlreads better in a link preview thanoutput.html, and some hosts derive the page title from it. - Do not zip it. A zip of one HTML file makes the reader download, extract and find the page. Upload the
.htmlitself.
When a link is the wrong answer
HTML is a sharing format, not a submission format. Some destinations will still want something else:
- Journals, grant portals and university systems usually require PDF. Convert the notebook with page breaks you have actually looked at — the IPYNB to PDF guide compares the routes.
- Reviewers who leave comments in the margin want Word. A DOCX export keeps headings, code and outputs editable in Word, Google Docs or LibreOffice; the DOCX versus PDF comparison covers which to send.
- A colleague who will run the code needs the
.ipynb, not a rendering of it. Send the notebook, and the HTML link alongside it so they can see the intended output.
The pattern is simple: HTML for reading, PDF for submitting, DOCX for editing, .ipynb for running.
The short version
jupyter nbconvert --to html --embed-images notebook.ipynb, or export in the browser converter.- Open the file alone, offline, and confirm the plots and styling survive.
- Clear anything private from the outputs before the page is public.
- Upload the single
.htmlto a static host and share the URL. - Keep the notebook as the source of truth and re-export when it changes.
A notebook that lives behind a link is easier to review, easier to cite and easier to hand to someone who has never installed Jupyter — and the whole process costs one command and one upload.