Your Guide to How To Add Tags To Cells In Jupyter Notebook

What You Get:

Free Guide

Free, helpful information about Web Development & Design and related How To Add Tags To Cells In Jupyter Notebook topics.

Helpful Information

Get clear and easy-to-understand details about How To Add Tags To Cells In Jupyter Notebook topics and resources.

Personalized Offers

Answer a few optional questions to receive offers or information related to Web Development & Design. The survey is optional and not required to access your free guide.

How to Add Tags to Cells in Jupyter Notebook

Jupyter Notebook cells aren't just containers for code or markdown — they can carry metadata, and one of the most practical forms of that metadata is cell tags. Tags let you label individual cells with custom identifiers, which tools like nbconvert, papermill, and testing frameworks can then act on in meaningful ways.

If you've ever needed to skip a cell during export, inject parameters into a notebook programmatically, or hide certain output from a rendered report, tags are the mechanism that makes all of that possible.

What Are Cell Tags in Jupyter Notebook?

A cell tag is a short string of text stored in the cell's metadata — not in the code itself. Tags live in the notebook's underlying .ipynb JSON file under the metadata.tags key for each cell. They're invisible during normal execution and don't affect how code runs, but they act as flags that external tools can read.

Common uses include:

  • parameters — marks a cell as the injection point for papermill, allowing notebooks to accept external inputs at runtime
  • remove-input or remove-output — signals to nbconvert or Jupyter Book to hide specific parts of a cell when building HTML or PDF outputs
  • skip — used by some testing frameworks to exclude a cell from automated runs
  • Custom tags — anything you define for your own pipeline logic

Tags are completely freeform strings. You define them, and the tools that consume the notebook decide what to do with them.

How to Add Tags Using the Jupyter Notebook Interface

Classic Jupyter Notebook (.ipynb interface)

In the classic interface, cell tags are tucked inside the Cell Toolbar.

  1. Open your notebook.
  2. Go to View in the top menu, then select Cell Toolbar → Tags.
  3. A tag input bar will appear at the top of every cell.
  4. Click inside the tag field for the cell you want to tag, type your tag name, and press Enter or Add tag.

The tag will appear as a small badge. You can add multiple tags to the same cell and remove them by clicking the × next to each tag.

JupyterLab

JupyterLab handles tags through the Property Inspector panel, not a toolbar.

  1. Click on the cell you want to tag to select it.
  2. Open the Property Inspector by clicking the settings icon (⚙️) in the right sidebar, or go to View → Show Right Sidebar.
  3. Expand the Common Tools or Cell Metadata section.
  4. You'll see a Tags field. Type your tag and press Enter to add it.

In newer versions of JupyterLab (3.x and later), the right panel integrates this more cleanly, but the location of the tag field can shift slightly depending on your installed extensions and version.

How to Add Tags Directly in the Notebook Metadata

If you prefer working closer to the source — or you're automating notebook configuration — tags can be added directly to the .ipynb file, which is plain JSON.

Each cell object in the cells array contains a metadata field. To tag a cell, add a tags key with a list of strings: