What Is Jupyter and How Do Jupyter Notebooks Work?

Updated

Jupyter is an open-source interactive computing environment where you write code in small chunks called cells, run each cell, and see its output directly below it. That run-and-inspect loop is the whole point: instead of writing a full script and running it top to bottom, you build an analysis one step at a time, checking results as you go. It's most useful when the work is exploratory — cleaning data, testing a model, or teaching a concept — and less useful for long-running production jobs.

The notebook model: cells, kernels, and outputs

A Jupyter notebook is a document made of cells. Each cell holds one of a few kinds of content:

  • Code cells — Python (or another language) that you execute.
  • Markdown cells — formatted text, headings, and explanations that sit between code.
  • Outputs — whatever the code produces: printed text, tables, charts, or errors, saved under the cell that generated it.

Code doesn't run on its own. A kernel is the process that actually executes your cells and holds the variables in memory. When you run a cell, it's sent to the kernel, executed, and the result is returned to the notebook. This is why variables you define in one cell are still available in the next — the kernel keeps the state alive between runs.

Because the kernel is separate from the document, Jupyter supports multiple languages. The same notebook interface can run Python, R, Julia, and others, depending on which kernel you start. The name "Jupyter" itself reflects this: it stands for Julia, Python, and R.

The typical workflow

The core loop is simple, and most of the skill is in how you sequence it:

  1. Write a cell — a few lines of code, or a markdown note describing what you're about to do.
  2. Run it — send the cell to the kernel.
  3. Inspect the output — read the table, chart, statistic, or error that comes back.
  4. Decide the next step — fix an error, adjust an approach, or move forward based on what you actually saw.

This is different from running a script end to end. In a script, a mistake on line 40 might not surface until everything before it has run. In a notebook, you catch it immediately, in context, and correct it before building on top of it.

A practical consequence: cell order matters, but not the order on the page. You can run cells out of sequence, which means the notebook's visible layout doesn't always match the order things executed. If results look inconsistent, re-running from the top is the usual fix.

What people use Jupyter for

Notebooks fit work where you need to see intermediate results:

  • Data analysis — load a dataset, inspect it, transform it, and visualize it, checking each stage.
  • Machine learning — train and evaluate models, comparing runs and reading metrics as they come back.
  • Teaching and learning — pair an explanation with runnable code so a concept can be tested immediately rather than taken on faith.
  • Reproducible reporting — combine code, results, and written interpretation in one shareable document.

The common thread is that the output informs the next decision. If your task is a fixed, repeatable pipeline with no inspection needed, a plain script is usually the better fit.

How tools and AI agents work inside notebooks

Because a notebook is a structured document — cells, code, and outputs all in one place — software can read it and act on it. AI agents built for Jupyter take advantage of this: they can inspect the notebook's context, write and run code, read the outputs, and continue from what actually happened rather than from a guess.

Runcell, for example, describes itself as "the AI agent that works inside Jupyter," turning a question into an executed workflow. Its stated loop is inspect the context → plan and execute → read the outputs → keep moving, which mirrors the manual workflow above but automates the steps between prompts. That's a useful illustration of the notebook model: the value of an agent here comes from the same run-and-inspect cycle a person would follow, just carried out continuously.

Where to go next

If you're new to Jupyter, the fastest way to understand it is to run a notebook yourself: write one line of code, run the cell, and look at the output. Everything else — kernels, cell types, multi-language support, and agent tooling — builds on that single loop.