Jupyter Notebook Keyboard Shortcut Keys: Complete List (With Functions Explained)

Jupyter Notebook (and JupyterLab) has two keyboard worlds: Command Mode, where keys manage cells themselves, and Edit Mode, where keys edit inside a cell. Blue border means Command Mode, green means Edit Mode — Esc and Enter switch between them. This complete list of Jupyter Notebook keyboard shortcut keys explains both modes in plain words.

Switching Modes and Running Cells

Shortcut KeyFunction
EscEnter Command Mode (from Edit Mode)
EnterEnter Edit Mode for the selected cell
Shift + EnterRun the cell and move to the next one
Ctrl + EnterRun the cell and stay on it
Alt + EnterRun the cell and insert a new cell below
Ctrl + SSave the notebook
Ctrl + Shift + P (JupyterLab)Open the Command Palette
Ctrl + Shift + C (classic Notebook)Open the Command Palette
H (Command Mode)Show the keyboard shortcuts help dialog

Command Mode Shortcuts (managing cells)

Shortcut KeyFunction
Up / Down Arrow (or K / J)Select the cell above / below
AInsert a cell Above
BInsert a cell Below
YChange the cell to Code
MChange the cell to Markdown
RChange the cell to Raw
1 to 6Change the Markdown cell to Heading level 1–6
D, D (press D twice)Delete the selected cells
ZUndo the last cell deletion
XCut the selected cells
CCopy the selected cells
VPaste cells below
Shift + VPaste cells above
Shift + MMerge the selected cells
Shift + Arrow keysExtend the cell selection up/down
LToggle line numbers in the selected cells
Shift + LToggle line numbers in all cells
OToggle the cell output visibility
Shift + OToggle output scrolling for the cell
I, I (press I twice)Interrupt the kernel (stop a running cell)
0, 0 (press 0 twice)Restart the kernel
Space / Shift + SpaceScroll the notebook down / up
SSave the notebook

Edit Mode Shortcuts (inside a cell)

Shortcut KeyFunction
Tab (with partial code)Show code completion suggestions
Tab (on selected lines)Indent the lines
Shift + TabShow the tooltip/help for the object (press twice for the full help)
Shift + Tab (on selected lines)Dedent the lines
Ctrl + ]Indent
Ctrl + [Dedent
Ctrl + /Comment / uncomment the selected lines
Ctrl + Shift + - (minus)Split the cell at the cursor
Ctrl + ASelect all the code in the cell
Ctrl + ZUndo (inside the cell)
Ctrl + Shift + Z or Ctrl + YRedo
Ctrl + Left / Right ArrowMove by word
Ctrl + Backspace / Ctrl + DeleteDelete the word before / after the cursor
Ctrl + Home / Ctrl + EndMove to the cell start / cell end
Alt + Up / Down Arrow (JupyterLab)Move the current line up / down
Ctrl + D (JupyterLab)Select the next occurrence (multi-cursor find match)
EscBack to Command Mode

Tips for Jupyter Users

The run trio is everything: Shift + Enter (run + advance), Ctrl + Enter (run in place) and Alt + Enter (run + fresh cell below) cover 90% of notebook work. When a cell hangs, I I interrupts the kernel without losing variables; 0 0 restarts it clean. And Shift + Tab over any function name opens its documentation inline — the fastest way to check arguments without leaving the notebook.

Frequently Asked Questions

What is the difference between Command Mode and Edit Mode in Jupyter?

Edit Mode (green border) edits inside one cell; Command Mode (blue border) treats cells as objects — moving, copying, deleting and converting them. Esc enters Command Mode, Enter enters Edit Mode.

How do I run a cell and stay on it in Jupyter?

Press Ctrl + Enter. Shift + Enter runs and moves down; Alt + Enter runs and inserts a new empty cell below.

How do I delete a cell in Jupyter Notebook?

In Command Mode, select the cell and press D twice (D, D). Press Z to undo the deletion.

How do I stop a running cell in Jupyter?

Press I twice (I, I) in Command Mode to interrupt the kernel, or use the stop button in the toolbar — your variables stay intact.

By Umar Farooq, Tech Know.

Post a Comment

0 Comments