Skip to content
AI & MLbeginner

What is Jupyter Notebook?

Updated Nov 30, 20263 min readBased on official documentation
What is Jupyter Notebook?

In short

Jupyter Notebook is a web-based tool for writing and running code in a single document. A notebook mixes code, plain text notes, data and charts, so you can test ideas step by step and share the result with others. It is part of the wider Project Jupyter ecosystem.

What a notebook is

A notebook is a shareable document. It holds computer code, plain language explanations, data, charts and graphs, and small interactive controls. You read it from top to bottom, run pieces of code one at a time, and see the results right under each piece.

This makes notebooks popular for exploring data and testing ideas. You can change one line, run it again, and see the new output without restarting your whole program. The documentation describes notebooks as a fast interactive environment for prototyping code, exploring and visualizing data, and sharing ideas with others.

How it works

Jupyter is an umbrella project. It covers many tools, and the two best known are Jupyter Notebook and JupyterLab. Both are web-based editors. You open them in a browser, while a small background process runs the code on your own machine.

A notebook is split into cells. A code cell holds code you can run. A text cell holds notes written in plain language. Each cell can be run on its own, and the output appears below it. Because the state is kept between cells, a variable you define in one cell can be used in another.

Jupyter Notebook is the simpler option. It offers a lightweight editing experience with fewer extras. JupyterLab is a more feature-rich choice. It opens several notebooks in tabs and lets you arrange the interface and use a system console. Many beginners start with Jupyter Notebook and move to JupyterLab later.

When to use it

Notebooks fit best when you want to learn, experiment or explain your work. Typical uses include:

  • Trying out a small piece of code before adding it to a project
  • Loading a dataset and making charts to understand it
  • Writing a report that mixes code, results and written explanation
  • Sharing a reproducible example with a colleague

Notebooks are less suited to large, long-running programs. Those are usually better kept in regular code files that run from the command line.

A simple example

Once Jupyter is installed, you start the editor from a terminal with a command like this:

jupyter notebook

Your browser opens a page listing the files in the current folder. You create a new notebook, then type a short line in a code cell, such as a calculation or a print statement. Press the run button or use the keyboard shortcut, and the result appears below the cell. You can then add a text cell above it to explain what the code does. Saving the notebook stores the code, the text and the outputs in one file.

The official documentation also offers a way to try Jupyter in your browser without installing anything, which is a good first step if you only want to look around.

Common mistakes

Beginners often run cells out of order. The output then depends on which cells ran earlier, not on the order you see on the page. If results look strange, restart the kernel, which is the background process that runs your code, and run the cells again from top to bottom.

Another common issue is forgetting that variables stay in memory. A value you deleted from a cell may still exist until you restart. Keeping your notebook tidy and re-running it from the start helps avoid confusion.

Alternatives

If you need a more traditional development setup, a code editor with plain script files may suit you better. You can also read the documentation for the individual Jupyter sub-projects, such as nbconvert for converting notebooks to other formats, or nbviewer for viewing them online. Choose the tool that matches the job in front of you.

FAQ

Do I need to install anything to use Jupyter Notebook?

Not always. The documentation lists a way to try Jupyter in your browser with no installation. To run it on your own computer, you install it locally first.

What is the difference between Jupyter Notebook and JupyterLab?

Jupyter Notebook is a simpler, lightweight editor. JupyterLab offers more features, including tabbed editing of several notebooks and a customizable layout.

What file does a notebook save as?

A notebook is saved as a single document that keeps your code, text notes and outputs together. Check the official documentation for the exact file format details.

Can I share a notebook with other people?

Yes. A notebook is designed to be shared, so others can read your code, notes and results and run the code themselves.

Sources

This page is based on the official documentation below. Read it for full detail.

Jupyter Notebook — official documentation ↗

Jupyter Notebook in the news

blozhikDeveloper news from across the web, explained. Every story links to its original sources.