File Extension File Extension Guide

What is an IPYNB File?Jupyter

A technical reference for the .ipynb extension, a Jupyter Notebook. What an IPYNB file is, how it keeps code, results and text together, what is inside it, and how you open and convert one.

Jupyter Notebook ๐Ÿ“ JSON File ๐Ÿงช Code and Output ๐Ÿ“Š Data Science
.IPYNB

Jupyter Notebook

Type:Notebook document
Extension:.ipynb
Stored as:JSON
App:Jupyter
Field:Data science

๐Ÿ“– What is an IPYNB File?

An IPYNB file is a Jupyter Notebook. It uses the .ipynb extension, and it holds an interactive document that brings together live code, the results that code produces, and written explanation, all in one place.

The name is short for Interactive Python Notebook, a nod to its roots in the IPython project. Although it began with Python, a notebook today can run many other languages too. What sets it apart from a plain script is that it saves not just the code but the output that code created, from tables and charts to images.

Under the surface the whole notebook is written as JSON, a structured text format. You rarely see that directly, because an application turns it into the tidy page of headings, code and results you actually work with. This is why a notebook opens as a document rather than as raw text.

Key Characteristics

  • A Jupyter Notebook, an interactive document
  • Mixes code and prose, in one file
  • Saves the output, alongside the code
  • Written as JSON, a structured format

Good to Know

  • From the IPython project, in the early 2010s
  • Runs many languages, not only Python
  • Built around cells, small blocks of content
  • A staple of data science, and teaching
๐Ÿ’ก Why it matters: Seeing a .ipynb as a document that stores code together with its results and notes explains its appeal. It is a complete, runnable record of a piece of work, not just the instructions to reproduce it.

โšก Quick Facts

File Extension.ipynb
Full NameInteractive Python Notebook
CategoryNotebook document
Main ApplicationJupyter Notebook and JupyterLab
Stored AsJSON text
FromThe IPython project
Schemanbformat, currently version 4
Common FieldData science and research
Related Extensions.py, .json, .html

๐Ÿงฑ Cells Explained

A notebook is built from cells, small blocks stacked down the page. Each cell is one of three kinds, and mixing them is what gives a notebook its character.

Code

Code Cells

Hold runnable code, and keep the results it produced saved right beneath them.

Markdown

Markdown Cells

Carry formatted notes, headings, lists and equations that explain the work.

Raw

Raw Cells

Pass plain text straight through untouched, for content a tool should leave alone.

You run a code cell and its output, a number, a table, a chart, appears just below it and is saved into the file. A markdown cell alongside it explains what the code does. Reading top to bottom, a notebook becomes a narrated walk through an analysis, which is exactly what makes the format so useful for sharing work.

One notebook, cells read top to bottom MARKDOWN # A heading and a note explaining what comes next CODE plot(data) OUTPUT the saved chart or table this code produced MARKDOWN The narrative continues, explaining the result above CODE summary(data) explanation, code and results in one flowing document

๐Ÿ” What Is Inside

Since it is JSON underneath, the raw content of a notebook is readable if you look. A small slice shows the shape, a list of cells, each labelled with its type and its content.

A single cell in the raw file

{
  "cell_type": "code",
  "execution_count": 1,
  "source": ["print('hello')"],
  "outputs": [{ ... the saved result ... }]
}

At the top level the file records its list of cells, some overall metadata, and the version of the notebook format it follows. Each code cell keeps its source, an execution_count showing the order it was run, and its outputs. Those outputs can be plain text or richer things, a chart stored as an encoded image, or a table stored as HTML, which is how a notebook carries its results inside itself.

โš™๏ธ Kernels and Languages

When you run a cell, the code does not execute inside the file itself. It is handed to a kernel, a separate engine that runs the code and sends the results back to be saved.

The kernel is what ties a notebook to a language. A Python kernel runs Python, but kernels exist for R, Julia, Scala and dozens more, so the same notebook format serves far beyond its Python beginnings. The notebook records which kernel it expects in its metadata, which is how an application knows what to start when you open the file. Swap the kernel and the very same notebook layout can hold a different language entirely.

๐Ÿ’ก The name gives it away: The Ju, Py and R in Jupyter nod to Julia, Python and R, the three languages it first set out to serve. The format was built from the start to be more than a Python tool.

๐ŸŽฏ Why People Use It

The notebook format took hold for a simple reason. It lets you think, compute and explain in one place, which suits a lot of modern work.

Explore

Exploring Data

Try an idea, see the result at once, and adjust, without leaving the document.

Teach

Teaching

Explanations sit next to working examples a learner can run and change.

Share

Sharing Results

Send a complete record, code and findings together, that others can rerun.

Reproduce

Reproducing Work

Anyone with the file can follow the same steps and reach the same numbers.

๐Ÿ“‚ How to Open an IPYNB File

Several tools open a notebook, from a quick browser preview to a full working environment. Which suits you depends on whether you want to read it or run it.

1

A quick preview

Univik's File Viewer displays a .ipynb straight in the browser, laying out its cells with no setup.

2

The Jupyter app

Jupyter Notebook or JupyterLab opens one fully, letting you edit and rerun every cell.

3

An editor or the cloud

VS Code opens notebooks directly, and Google Colab runs one online with nothing installed.

The two Jupyter apps differ in feel rather than format. The classic Jupyter Notebook shows a single notebook per tab, while JupyterLab wraps the same notebooks in a workspace where you arrange several documents, a file browser and a terminal side by side. Both read and write the identical .ipynb file, so the choice is about how you like to work.

๐Ÿ’ก Just reading it? To view a notebook and its saved results without starting a whole environment, the File Viewer renders a .ipynb in the browser. GitHub also displays any notebook you upload to a repository.

๐Ÿ”„ Converting a Notebook

A notebook is often turned into another format to share it with people who will not run it, or to fit it into a report or a code base.

Univik's File Converter changes a .ipynb into formats like HTML, PDF or a plain Python script in the browser. An HTML or PDF copy is ideal for a reader who just wants to see the work, code and charts laid out as a finished document. A Python export pulls out the code alone for use as a normal script, though it drops the saved outputs, since a script cannot hold a chart the way a cell can. The official Jupyter tool for this, nbconvert, offers the same exports from the command line.

One quirk is worth knowing about PDF. Producing a PDF the traditional way relies on a LaTeX system being installed, which not everyone has, so a common shortcut is to export to HTML first and then print that page to PDF from the browser. Univik's File Converter sidesteps the setup by handling the conversion for you.

๐Ÿ’ก Two directions of conversion: Exporting to HTML or PDF keeps the results for reading, while exporting to a Python script keeps only the code for running. Picking the right one depends on whether your reader wants to look or to execute.

โœ๏ธ Editing the JSON

Because a notebook is JSON text, it is tempting to open one in a plain editor and change it by hand. That is possible, but it comes with a real risk.

โš ๏ธ Edit the raw file with care: The internal structure of a notebook is easy to break. A stray comma or bracket can leave the whole file impossible to load, so hand-editing the JSON is best avoided unless you know the format well. Let the Jupyter application make the changes instead.

There is one time it helps to know the file is JSON. In version control, tools compare notebooks line by line as text, and the readable layout makes changes easier to follow. Even then, the safe way to alter a notebook is to open it in a notebook tool and edit the cells there, letting the application keep the structure valid.

๐Ÿ”€ Notebooks and Version Control

Because a notebook saves its output inside the file, tracking one in version control brings a snag worth planning for. A chart or a table sits in the JSON as a long block of encoded data, and each rerun rewrites it.

The upshot is that committing a notebook as-is can produce enormous, noisy differences that bury the actual code change under pages of output data. The common fix is to clear the output before committing, either with the Clear All Output command in the notebook interface or with a small tool called nbstripout that does it automatically as part of your commit. Your working copy keeps its results, while the version that gets committed stays lean and readable.

๐Ÿ’ก A cleaner history: Stripping output before a commit keeps a notebook's history focused on code, makes reviews easier to read, and shrinks the file. The results are easy to regenerate by running the notebook again.
Clearing output before a commit notebook with output code large blocks of saved results clear just the code code output cleared commit small, clean difference easy to review

๐Ÿ› ๏ธ Common Issues

Most trouble with a notebook comes from a broken structure or from a missing environment to run it in. The usual cases are quick to place.

Won't loadThe JSON is damaged, often from hand-editing. A backup or version history is the way back.
Opens as textThe file shows as raw JSON. Open it in Jupyter, VS Code or the File Viewer to render the cells.
Code won't runThe kernel it needs is not installed. The right language kernel has to be present to rerun cells.
Saved as .jsonA download or export renamed it. Restoring the .ipynb extension lets an application recognise it.

๐Ÿ”€ Related Formats

A .ipynb sits among the formats it is often turned into or compared with.

.pyA plain Python script, the code from a notebook without its saved output or cells.
.jsonThe underlying text format a notebook is written in, used widely for structured data.
.htmlA common export of a notebook, a fixed page that shows the code and results to a reader.
.mdMarkdown, the format a notebook's text cells use, and another export option.
.rmdAn R Markdown document, a related notebook-style file from the R world.

โ“ Frequently Asked Questions

Several tools open a .ipynb file. For a quick look without any setup, Univik's File Viewer renders the notebook and its saved results in your browser. To edit and rerun it, the Jupyter Notebook or JupyterLab application opens it fully, and VS Code handles notebooks directly. Google Colab runs one in the cloud with nothing to install. If you only need to read a notebook that lives online, nbviewer and GitHub both display .ipynb files as rendered pages.

An IPYNB file is a Jupyter Notebook, an interactive document that keeps code, the results that code produced and written explanation together in one file. The name stands for Interactive Python Notebook, from its origins in the IPython project, though notebooks now run many languages beyond Python. The file itself is stored as JSON, a structured text format, which an application turns into the readable page of cells you work with. It is a mainstay of data science, teaching and research.

No. A Python file, ending in .py, is a plain script of code that runs top to bottom. A .ipynb notebook is richer, splitting work into cells, mixing formatted text with the code, and saving the output each code cell produced, from tables to charts. You can export a notebook to a .py script, but that keeps only the code and drops the saved results and the notes. A script is for running, while a notebook is for exploring and explaining.

Because a notebook is stored as JSON underneath, and something is showing you that raw text instead of rendering it. Opening the file in a notebook tool such as Jupyter or JupyterLab, in VS Code, or in Univik's File Viewer turns that JSON into the proper page of cells and results. If the file was renamed to end in .json during a download or export, restoring the .ipynb extension helps an application recognise it as a notebook again.

Converting a notebook to HTML or PDF gives a fixed copy that shows the code and results as a finished page, ideal for a reader who will not run it. Univik's File Converter does this in the browser, and the official Jupyter tool nbconvert offers the same exports from the command line. An HTML export opens in any browser, while a PDF is handy for printing or attaching. Both keep the saved outputs, so charts and tables appear just as they do in the notebook.

Cells are the building blocks of a notebook, small blocks stacked down the page. There are three kinds. A code cell holds runnable code and keeps its results saved beneath it. A markdown cell holds formatted text, headings, lists and equations that explain the work. A raw cell passes plain text through untouched. Reading the cells in order turns a notebook into a narrated walk through an analysis, which is what makes the format good for sharing and teaching.

A kernel is the engine that actually runs a notebook's code. When you run a cell, the code is sent to the kernel, which executes it and returns the results to be saved in the file. The kernel is what ties a notebook to a language, so a Python kernel runs Python, while kernels for R, Julia, Scala and many other languages let the same notebook format serve them too. A notebook records which kernel it expects, so the application knows what to start when you open it.

You can, because it is JSON text, but it is risky. The internal structure is easy to break, and a single misplaced comma or bracket can leave the file impossible to load. For that reason hand-editing the raw JSON is best avoided unless you know the format well. The safe way to change a notebook is to open it in Jupyter, JupyterLab or VS Code and edit the cells there, letting the application keep the underlying structure valid.

IPYNB stands for Interactive Python Notebook. The name comes from the IPython project, where the format began, and the extension has stuck even though notebooks now run far more than Python. It is a fitting name, since the whole point of the format is interactivity, letting you write code, run it, and see the result immediately, all inside a single document that also holds your notes. The word notebook captures that blend of working and explaining in one place.

Because a notebook lets you compute, see results and explain all in one document. That fits exploring data, where you try an idea and view the outcome at once, and it fits teaching, where explanations sit beside working examples a learner can run. It also suits sharing, since a notebook carries its results inside it, so a colleague receives a complete record rather than just the code. And it supports reproducible work, letting anyone with the file follow the same steps to the same numbers.

Not to read one. Univik's File Viewer, nbviewer and GitHub all render a notebook and its saved results without running anything, and an HTML export opens in any browser. You only need a language installed when you want to rerun the code, and even then it need not be Python, since notebooks run many languages through their kernels. So viewing a shared notebook is easy, while executing its cells is what calls for the matching kernel to be present.

Because a notebook stores its results inside the file, committing one with its output creates large, noisy differences in version control. To avoid that, clear the output first. The Clear All Output command in the Jupyter interface does it by hand, and a tool called nbstripout does it automatically at commit time, stripping results from what gets committed while leaving your working copy untouched. The result is a lean, readable history focused on the code, and the outputs can be regenerated by rerunning the notebook.

The traditional PDF export relies on a LaTeX system being installed on your machine, and if that is missing the export fails. You can install a LaTeX distribution such as MiKTeX, TeX Live or MacTeX to make it work, but a quicker route is to export the notebook to HTML and then print that page to PDF from your browser. Univik's File Converter avoids the setup entirely by handling the conversion for you, so no LaTeX install is needed.

They are two interfaces for the same notebooks. The classic Jupyter Notebook opens one notebook per browser tab, a simple and focused view. JupyterLab is the newer environment that wraps notebooks in a fuller workspace, letting you arrange several documents, a file browser and a terminal side by side. Both read and write the same .ipynb file, so a notebook made in one opens fine in the other, and the choice comes down to how much you want around you while you work.

๐Ÿ“ Summary

An IPYNB file is a Jupyter Notebook, an interactive document that keeps code, the results that code produced and written explanation together in one file. The name is short for Interactive Python Notebook, from its start in the IPython project, though a notebook now runs many languages through its kernel, the engine that executes the code. The file is stored as JSON and built from cells. Code cells hold runnable code and their saved output, markdown cells carry formatted notes, and raw cells pass text through untouched. That blend of live code, results and prose is why the format is central to data science, teaching and reproducible research. You open a .ipynb in Univik's File Viewer for a quick browser preview, or in Jupyter, JupyterLab, VS Code or Google Colab to run it, and GitHub renders one on sight. To share a notebook with people who will not run it, Univik's File Converter and the official nbconvert tool export it to HTML, PDF or a plain Python script. Because it is JSON underneath it can be opened in a text editor, but hand-editing the raw structure is easy to break, so changing the cells inside a notebook tool is the safer path.