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:
- Shift + Enter – Run the current cell and select the cell below
- Ctrl + Enter (Cmd + Enter on Mac) – Run the current cell, stay on it
- Alt + Enter (Option + Enter on Mac) – Run the cell and insert a new one below
- Esc – Switch to command mode
- Enter – Switch to edit mode
- A – Insert a cell above (command mode)
- B – Insert a cell below (command mode)
- D, D (press D twice) – Delete the selected cell (command mode)
- M – Convert cell to Markdown (command mode)
- Y – Convert cell to code (command mode)
Most-Used Jupyter Notebook Shortcuts
| Action | Windows / Linux | Mac |
|---|---|---|
| Run cell, select cell below | Shift + Enter | Shift + Enter |
| Run cell, stay on cell | Ctrl + Enter | Cmd + Enter |
| Run cell, insert below | Alt + Enter | Option + Enter |
| Save and checkpoint | Ctrl + S | Cmd + S |
| Enter edit mode | Enter | Enter |
| Enter command mode | Esc | Esc |
| Show keyboard shortcut help | H | H |
| Open command palette | Ctrl + Shift + P | Cmd + Shift + P |
Command Mode Shortcuts (Windows & Mac)
| Action | Windows / Linux | Mac |
|---|---|---|
| Insert cell above | A | A |
| Insert cell below | B | B |
| Delete selected cell | D, D (press twice) | D, D (press twice) |
| Undo cell deletion | Z | Z |
| Cut selected cell | X | X |
| Copy selected cell | C | C |
| Paste cell below | V | V |
| Paste cell above | Shift + V | Shift + V |
| Select cell above | K or Up Arrow | K or Up Arrow |
| Select cell below | J or Down Arrow | J or Down Arrow |
| Convert cell to code | Y | Y |
| Convert cell to Markdown | M | M |
| Convert cell to raw | R | R |
| Apply heading level 1–6 | 1 … 6 | 1 … 6 |
| Merge cell below | Shift + M | Shift + M |
| Toggle line numbers | L (or Shift + L in newer versions) | L (or Shift + L in newer versions) |
| Toggle cell output | O | O |
| Toggle output scrolling | Shift + O | Shift + O |
| Interrupt kernel | I, I (press twice) | I, I (press twice) |
| Restart kernel | 0, 0 (press twice) | 0, 0 (press twice) |
| Go to cell start | Ctrl + Home | Cmd + Up |
| Go to cell / notebook end | Ctrl + End | Cmd + Down |
| Scroll notebook down | Spacebar | Spacebar |
| Scroll notebook up | Shift + Spacebar | Shift + Spacebar |
| Show shortcut help dialog | H | H |
| Enter edit mode | Enter | Enter |
Edit Mode Shortcuts (Windows & Mac)
| Action | Windows / Linux | Mac |
|---|---|---|
| Enter command mode | Esc | Esc |
| Code completion / indent | Tab | Tab |
| Tooltip / docstring | Shift + Tab | Shift + Tab |
| Indent | Ctrl + ] | Cmd + ] |
| Dedent | Ctrl + [ | Cmd + [ |
| Select all | Ctrl + A | Cmd + A |
| Undo | Ctrl + Z | Cmd + Z |
| Redo | Ctrl + Shift + Z | Cmd + Shift + Z |
| Comment / uncomment line | Ctrl + / | Cmd + / |
| Split cell at cursor | Ctrl + Shift + Minus | Cmd + Shift + Minus |
| Go to cell start | Ctrl + Home | Cmd + Up |
| Go to cell end | Ctrl + End | Cmd + Down |
| Move one word left | Ctrl + Left | Option + Left |
| Move one word right | Ctrl + Right | Option + Right |
| Delete word before cursor | Ctrl + Backspace | Option + Delete |
| Delete word after cursor | Ctrl + Delete | Option + Fn + Delete |
| Save and checkpoint | Ctrl + S | Cmd + S |
JupyterLab & Notebook 7 Shortcuts (what’s different)
| Action | Classic Notebook | JupyterLab / Notebook 7 |
|---|---|---|
| Open command palette | Ctrl/Cmd + Shift + P | Ctrl/Cmd + Shift + C |
| Toggle line numbers | L | Shift + 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 kernel | 0, 0 | 0, 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:





