Jupyter Notebook is an open-source, browser-based interactive computing environment in which a document called a notebook combines executable code, its output, visualizations and formatted explanatory text. Among development tools in programming, it is the standard medium for exploratory data analysis, scientific computing, teaching and documenting reproducible experiments.
The project grew out of IPython in 2014, and the name refers to its original core languages: Julia, Python and R. Today, Jupyter supports dozens of languages through kernels, and the term Jupyter is often used for the whole family of tools, including the newer JupyterLab interface and hosted notebook services built on the same open file format.
How Jupyter Notebook executes code
Jupyter uses a client-server architecture with three parts. The browser front end displays the notebook, a notebook server manages files and sessions, and a separate process called the kernel actually runs the code. The front end sends each cell to the kernel over the Jupyter messaging protocol, which uses ZeroMQ sockets, and receives results to display under the cell.
Because the kernel is a long-running process, variables persist between cell executions. A user can load a large dataset once and then experiment with many analyses without reloading it. This stateful execution model is the main source of both the productivity of notebooks and their most common bugs.
The table below describes the components and their responsibilities.
| Component | Role | Example |
|---|---|---|
| Front end | Displays and edits notebooks in the browser | Classic Notebook, JupyterLab |
| Notebook server | Serves files, manages sessions and kernels | Jupyter Server process |
| Kernel | Executes code and returns results | IPython kernel, IRkernel, IJulia |
| Messaging protocol | Carries execute requests and outputs | ZeroMQ channels with JSON messages |
| Notebook file | Stores cells, outputs and metadata | An .ipynb document |
Cells and the .ipynb file format
A notebook is a sequence of cells, and each cell has a type that determines how it behaves. A notebook file uses the .ipynb extension and is a JSON document that stores the source of every cell, its outputs, the execution count and metadata such as the kernel name.
| Cell type | Content | When it is used |
|---|---|---|
| Code cell | Source code sent to the kernel | Calculations, data loading, plotting |
| Markdown cell | Formatted text, equations, images | Explanations, headings, documentation |
| Raw cell | Unprocessed text | Content passed directly to export tools |
Outputs such as tables, images and interactive widgets are stored inside the file, often as base64-encoded images. This makes a notebook self-contained and readable without rerunning it, but it also makes files large and produces noisy version control diffs. Tools such as nbstripout remove outputs before a Git commit, and Jupytext pairs a notebook with a plain script for cleaner review.
The nbconvert tool exports notebooks to HTML, PDF, slides or plain scripts, while IPython magic commands such as %timeit and %matplotlib inline add conveniences specific to the Python kernel.
Jupyter Notebook compared with JupyterLab and IDEs
Jupyter Notebook is one of several ways to work with notebook files, and it differs from a full integrated development environment in purpose more than in capability. The classic interface focuses on one document at a time, while JupyterLab offers a multi-panel workspace, and editors such as Visual Studio Code can open .ipynb files natively.
| Tool | Strength | Weakness | Best fit |
|---|---|---|---|
| Jupyter Notebook | Simple, focused interface | Limited project navigation | Exploration, teaching |
| JupyterLab | Tabs, file browser, terminals, extensions | More complex interface | Daily data science work |
| Visual Studio Code | Notebooks plus debugger and Git | Heavier setup | Mixed notebook and module development |
| Traditional IDE with scripts | Refactoring, testing, packaging | No inline rich output | Production software |
Since version 7, the classic Jupyter Notebook interface is built on JupyterLab components, so both share extensions and the same server, while keeping the simpler single-document layout.
Typical uses and good practices
Notebooks excel when code, results and reasoning must be read together. Common uses include data cleaning and visualization, prototyping machine learning models, course materials, research supplements and reproducible reports. Hosted services such as Google Colab and JupyterHub deployments let teams run notebooks on shared servers or GPUs without local installation.
To keep notebooks reliable, experienced practitioners follow a few disciplined habits, summarized in the decision table below.
| Situation | Recommended practice | Reason |
|---|---|---|
| Before sharing results | Restart kernel and run all | Confirms the notebook runs top to bottom |
| Code reused in several notebooks | Move it into a Python module | Enables testing and single maintenance |
| Notebook kept under Git | Strip outputs or pair with Jupytext | Produces readable diffs |
| Dependency-sensitive analysis | Pin packages in an environment file | Makes results reproducible |
| Scheduled reporting | Run with papermill or nbconvert | Executes notebooks without a browser |
Limitations and common pitfalls
The best-known weakness of notebooks is hidden state. Cells can be executed in any order, deleted after running or edited without rerunning, so the visible document may not match the values held in the kernel. Studies of public notebooks have repeatedly found that many cannot be rerun successfully from top to bottom.
- Out-of-order execution, visible as nonsequential execution counts, which hides dependencies between cells.
- Large embedded outputs that inflate files and expose sensitive data when shared.
- Long notebooks used as production code, which resist testing and code review.
- Missing environment information, so results differ on another machine.
- Security risk from opening untrusted notebooks, because running cells executes arbitrary code.
For these reasons, many teams treat notebooks as an exploration and communication layer, while moving stable logic into versioned, tested modules.
Stripped to the essentials
A Jupyter notebook is like a lab journal that can run code. You write a small piece of code in a box and run it. The answer appears right below, as a number, a table or a chart. Notes and results stay side by side.
You can then explain what you found in normal text. Others can read the whole story or rerun it themselves. The main rule is simple: run the boxes in order, so the results stay correct.
Where it is applied
A data analyst at a regional hospital network is asked why emergency department waiting times rose during the winter. She opens a Jupyter notebook in JupyterLab, loads two years of anonymized visit records with pandas and plots arrivals by hour and weekday directly under the code.
Within an afternoon, the charts reveal that delays cluster between 6 p.m. and 10 p.m. on Mondays, when staffing is lowest. She adds Markdown cells that explain each step, restarts the kernel and runs all cells to confirm reproducibility, then exports the notebook to HTML for the management team. The result is a staffing change backed by transparent analysis, and the same notebook is rerun monthly with papermill to track whether waiting times improve.