Saved

Press the star next to a tool's name to save it.

All my tools

IPYNB to HTML Converter

Use this IPYNB converter to turn a Jupyter notebook into an HTML page, a Python script, LaTeX, a Word file, a PDF or a tidied notebook, with or without outputs.

Choose a Jupyter notebook (.ipynb) or paste its text, pick the format and press Convert. Markdown cells, code cells and, if you like, their outputs are carried over. Everything is converted in your browser.

Your notebook stays on your device. Nothing is uploaded.

Result

Choose a notebook, pick a format and press Convert.

Converting…

This IPYNB converter turns a Jupyter notebook into an HTML page, a Python script, LaTeX, Word, PDF or a tidied notebook file. Choose your .ipynb file, pick the format and press Convert. The converter reads the markdown and code cells and can carry over their outputs. It all happens in your browser, so your notebook is never uploaded.

How to use the IPYNB converter

  1. Choose your .ipynb file or paste its text.
  2. Pick the format to convert to.
  3. Tick Include the cell outputs if you want the results in the file.
  4. Press Convert, then download or copy the result.

What is inside a notebook file

The Jupyter documentation describes a notebook as a JSON file. At the top level it has the keys cells, metadata, nbformat and nbformat_minor. Each cell has a type of markdown, code or raw, and a source that is either one string or a list of strings. A markdown cell holds GitHub-flavored markdown. A code cell also has a list of outputs and an execution count that is an integer or null. The converter reads this structure directly. Notebooks saved in the old version 3 layout are not supported, and the converter tells you to open and save them again in Jupyter.

Outputs

The documentation lists four kinds of output. A stream output is text from standard output or standard error. A display data output and an execute result output hold a bundle of formats, such as plain text, HTML or a PNG image. An error output has the error name, its value and a traceback. The converter keeps text and error outputs, removing the color codes that terminals use in a traceback. Images are kept in the HTML page. The Word, PDF and LaTeX options cannot hold them, so the converter counts the images it left out and tells you.

Python script

The Python option writes the code cells as a script. Each cell starts with a comment line that marks it, so editors that understand these markers show the cells. Markdown cells become comments. Lines that start with a percent sign or an exclamation mark are notebook magics and shell commands, which Python cannot run, so the converter comments them out. Outputs are not part of a script.

HTML page

The HTML option makes one self-contained page with the markdown rendered, the code in boxes and the outputs below each code cell. Images are placed in the page as data, so a single file holds the whole notebook. It is a good way to share the results with someone who does not use Jupyter.

LaTeX

Wikipedia describes LaTeX as a software system for typesetting documents, and says its files use the extension .tex. A document starts with a document class line and sits between begin and end document commands. The converter writes an article with headings, lists, bold and italic text, links and code in verbatim blocks. The characters that LaTeX treats as special, such as the percent sign, the dollar sign, the ampersand, the underscore and the braces, are escaped. If your notebook contains text in non-Latin scripts, compile the file with an engine that handles Unicode.

Word and PDF

The Word file has headings, paragraphs, lists and a code style for code and outputs. The PDF uses the standard Helvetica and Courier fonts on Letter pages, so characters outside the Western European set are shown as question marks. Long code lines are broken at 82 characters. For wide code or other scripts, the HTML or Word option is a better choice.

Tidied notebook

The notebook JSON option writes the file again with a tidy layout. Untick the outputs box to clear every output and the execution counts. That is a common step before you share a notebook or put it under version control, since the outputs can be large and make the file change every time it runs.

Large notebooks

You can choose a notebook of up to 30 MB. Notebooks with many images in their outputs are large, because each image is stored as text inside the file. The preview box shows only the first part of a text result, but the download and the copy button hold all of it. If a large notebook is slow to convert, untick the outputs box, which skips the images and makes the result much smaller.

When to use each format

Use HTML to share the finished results, with charts, as one file. Use the Python script to move the code into an editor or a project. Use LaTeX if you are writing a paper and want to start from your analysis. Use Word or PDF for a plain report, with code and text outputs but without charts. Use the notebook JSON option to clean a notebook before you commit it.

Common mistakes

  • Pasting only part of the file. The text must be the whole notebook JSON.
  • Expecting images in Word or PDF. Use HTML to keep them.
  • Running the Python script as it is. Notebook magics are commented out, so check the result.
  • Using an old notebook format. Save it again in a current Jupyter first.

What next

Use this often? Add IPYNB to HTM to your Home screen.

Frequently asked questions

What is an IPYNB converter?

A tool that turns a Jupyter notebook file into another format, such as HTML, a Python script, LaTeX, Word or PDF.

How do I convert an ipynb file to Python?

Choose the file, pick Python script and press Convert. Code cells become the script and markdown cells become comments.

Are the outputs kept?

Text and error outputs are kept in HTML, LaTeX, Word and PDF. Images are kept in HTML only. Untick the box to leave outputs out.

Is my notebook uploaded?

No. The conversion happens in your browser.

Can I clear the outputs of a notebook?

Yes. Choose Notebook JSON and untick Include the cell outputs. The outputs and run counts are removed.

What went wrong?

We only receive the reason you pick, never what you typed into the tool.

Thanks for your feedback.

More Text & Writing Tools