Jupyter Notebook Keyboard Shortcuts (Windows & Mac) Complete List

Jupyter Notebook keyboard shortcuts let you run cells, switch cell types, and navigate your notebook without touching the mouse. The most-used shortcuts are Shift + Enter (run a cell and move down), Esc (enter command mode), Enter (enter edit mode), B (insert a cell below), and pressing D twice (delete a cell).

Jupyter has two modes edit mode (green cell border) and command mode (blue/gray border) and most shortcuts only work in command mode. The shortcuts below are organized by mode and include both Windows/Linux and Mac keys, plus the differences you’ll see in JupyterLab and Notebook 7.

Edit Mode vs Command Mode (read this first)

Before the shortcuts make sense, you need to know that Jupyter Notebook has two keyboard modes. Which mode you’re in decides what a keypress does the same key behaves differently in each.

Edit mode lets you type code or text inside a cell. The cell border turns green, and a pencil icon appears in the top-right. You enter edit mode by pressing Enter or clicking inside a cell.

Command mode lets you act on cells as a whole insert, delete, move, copy, or change cell type. The cell border is blue (gray in some themes). You enter command mode by pressing Esc or clicking the margin to the left of a cell.

Rule of thumb: if you want to change what’s inside a cell, use edit mode. If you want to do something to the cell itself, press Esc first to enter command mode. Most of the single-letter shortcuts below (B, D, M, Y) only work in command mode.

Top 10 Jupyter Notebook Shortcuts at a Glance

If you only memorize ten Jupyter Notebook shortcuts, make them these:

  1. Shift + Enter – Run the current cell and select the cell below
  2. Ctrl + Enter (Cmd + Enter on Mac) – Run the current cell, stay on it
  3. Alt + Enter (Option + Enter on Mac) – Run the cell and insert a new one below
  4. Esc – Switch to command mode
  5. Enter – Switch to edit mode
  6. A – Insert a cell above (command mode)
  7. B – Insert a cell below (command mode)
  8. D, D (press D twice) – Delete the selected cell (command mode)
  9. M – Convert cell to Markdown (command mode)
  10. Y – Convert cell to code (command mode)

Most-Used Jupyter Notebook Shortcuts

ActionWindows / LinuxMac
Run cell, select cell belowShift + EnterShift + Enter
Run cell, stay on cellCtrl + EnterCmd + Enter
Run cell, insert belowAlt + EnterOption + Enter
Save and checkpointCtrl + SCmd + S
Enter edit modeEnterEnter
Enter command modeEscEsc
Show keyboard shortcut helpHH
Open command paletteCtrl + Shift + PCmd + Shift + P

Command Mode Shortcuts (Windows & Mac)

ActionWindows / LinuxMac
Insert cell aboveAA
Insert cell belowBB
Delete selected cellD, D (press twice)D, D (press twice)
Undo cell deletionZZ
Cut selected cellXX
Copy selected cellCC
Paste cell belowVV
Paste cell aboveShift + VShift + V
Select cell aboveK or Up ArrowK or Up Arrow
Select cell belowJ or Down ArrowJ or Down Arrow
Convert cell to codeYY
Convert cell to MarkdownMM
Convert cell to rawRR
Apply heading level 1–61 … 61 … 6
Merge cell belowShift + MShift + M
Toggle line numbersL (or Shift + L in newer versions)L (or Shift + L in newer versions)
Toggle cell outputOO
Toggle output scrollingShift + OShift + O
Interrupt kernelI, I (press twice)I, I (press twice)
Restart kernel0, 0 (press twice)0, 0 (press twice)
Go to cell startCtrl + HomeCmd + Up
Go to cell / notebook endCtrl + EndCmd + Down
Scroll notebook downSpacebarSpacebar
Scroll notebook upShift + SpacebarShift + Spacebar
Show shortcut help dialogHH
Enter edit modeEnterEnter

Edit Mode Shortcuts (Windows & Mac)

ActionWindows / LinuxMac
Enter command modeEscEsc
Code completion / indentTabTab
Tooltip / docstringShift + TabShift + Tab
IndentCtrl + ]Cmd + ]
DedentCtrl + [Cmd + [
Select allCtrl + ACmd + A
UndoCtrl + ZCmd + Z
RedoCtrl + Shift + ZCmd + Shift + Z
Comment / uncomment lineCtrl + /Cmd + /
Split cell at cursorCtrl + Shift + MinusCmd + Shift + Minus
Go to cell startCtrl + HomeCmd + Up
Go to cell endCtrl + EndCmd + Down
Move one word leftCtrl + LeftOption + Left
Move one word rightCtrl + RightOption + Right
Delete word before cursorCtrl + BackspaceOption + Delete
Delete word after cursorCtrl + DeleteOption + Fn + Delete
Save and checkpointCtrl + SCmd + S

JupyterLab & Notebook 7 Shortcuts (what’s different)

ActionClassic NotebookJupyterLab / Notebook 7
Open command paletteCtrl/Cmd + Shift + PCtrl/Cmd + Shift + C
Toggle line numbersLShift + L
Toggle file browser(n/a)Cmd/Ctrl + B
Save As(menu only)Cmd/Ctrl + Shift + S
Run all cells(menu only)via command palette
Restart kernel0, 00, 0

Toggle Line Numbers in Jupyter (L / Shift + L)

To toggle line numbers on or off: press Esc to enter command mode, then press L. In JupyterLab and Notebook 7, the shortcut is Shift + L. You can also turn line numbers on for every cell from the View menu.

Go to the End of a Notebook

To jump to the end of a notebook: press Esc for command mode, then press Ctrl + End (Cmd + Down on Mac) to move to the last cell. To jump to the very top, use Ctrl + Home (Cmd + Up on Mac).

Frequently Asked Questions

How do I see all Jupyter Notebook shortcuts?

Press Esc to enter command mode, then press H to open the keyboard shortcut help dialog. This shows the full, up-to-date list for your Jupyter version. You can also open it from the Help menu.

What is the shortcut to toggle line numbers in Jupyter Notebook?

Press Esc for command mode, then press L. In JupyterLab and Notebook 7, use Shift + L. You can also toggle line numbers for all cells from the View menu.

How do I go to the end of a notebook?

Press Esc to enter command mode, then Ctrl + End (Cmd + Down on Mac) to jump to the last cell. Use Ctrl + Home (Cmd + Up on Mac) to jump back to the top.

How do I delete a cell in Jupyter Notebook?

In command mode, press D twice (D, D). To undo the deletion, press Z.

How do I run a cell in Jupyter Notebook?

Press Shift + Enter to run the cell and move to the next one, or Ctrl + Enter (Cmd + Enter on Mac) to run it and stay on the same cell. Alt + Enter runs the cell and inserts a new one below.

How do I insert a new cell?

In command mode, press A to insert a cell above the current one, or B to insert a cell below.

Are Jupyter Notebook shortcuts different on Mac?

Single-letter command-mode shortcuts (B, D, M, A, and so on) are identical on Mac. The difference is in modifier keys: Mac uses Cmd (⌘) instead of Ctrl and Option (⌥) instead of Alt for combinations like Cmd + Enter or Option + Enter.

How do I comment out a line in Jupyter Notebook?

In edit mode, press Ctrl + / (Cmd + / on Mac) to comment or uncomment the selected line or lines.

Is there a PDF cheat sheet for Jupyter Notebook shortcuts?

Yes you can download the free Jupyter Notebook shortcuts PDF from the cheat sheet section above to keep a printable reference handy.

How do I add or customize keyboard shortcuts in Jupyter?

In classic Notebook, open Help > Edit Keyboard Shortcuts. In JupyterLab and Notebook 7, open Settings > Settings Editor > Keyboard Shortcuts, or edit them via the Advanced Settings JSON.

Final Thoughts

Mastering even a handful of these Jupyter Notebook shortcuts will noticeably speed up your workflow the real gain comes from staying on the keyboard instead of reaching for the mouse. Start with the ten essentials above (Shift + Enter, Esc, B, D D, and M cover most of what you’ll do daily), then add the mode-specific shortcuts as they become second nature.

The fastest way to keep them handy is to press H inside any notebook to pull up the live shortcut list, or download the printable cheat sheet above and keep it next to your keyboard. Whether you’re on Windows, Mac, classic Notebook, or JupyterLab, the muscle memory transfers once these are automatic, you won’t go back.

READ NEXT:

Pratik

Pratik is the founder of Tutorial Tactic and a productivity tools specialist with 15 years of hands-on experience in Google Workspace, Microsoft Office, and software automation. He has published over 1,500 guides on keyboard shortcuts, software commands, how-to tutorials and workflow optimization, helping readers across the US and India work faster with the tools they use every day. Tutorial Tactic was founded in 2021 with one goal: cut through the noise and give readers exactly what they need fast, verified, and beginner-friendly.
Back to top button