W3docs

Keyboard Shortcuts

Keyboard shortcuts make using operating systems and computer software programs easier and save time. Get acquainted with the list of Basic Shortcuts.

Keyboard shortcuts are key combinations that invoke a command in the operating system or software — a command you could otherwise reach through a menu or with the mouse. They offer a faster, hands-on-the-keyboard way of working, which saves time once they become second nature. The exact keys depend on your platform: on Windows and Linux the Ctrl key is the usual modifier, while on Apple computers the Command (Cmd) key takes its place.

If you are learning HTML, keyboard shortcuts matter in two everyday places: your text editor (selecting, moving, copying, finding, and formatting markup as you type it) and your browser (reloading the page after a change, opening DevTools, and zooming to inspect your layout). Knowing the shortcuts on this page lets you write and preview HTML without constantly reaching for the mouse. For choosing where to write your markup, see HTML editors.

Here is why it pays off in a real edit loop. A typical pass while building a page looks like this:

  1. Edit the markup in your editor, then Ctrl + S (Cmd + S on Mac) to save.
  2. Switch to the browser window with Alt + Tab (Cmd + Tab on Mac).
  3. Press Ctrl + R / F5 (Cmd + R on Mac) to refresh and see the change. If a stale cached file is getting in your way, use a hard refresh: Ctrl + Shift + R / Ctrl + F5 (Cmd + Shift + R on Mac).
  4. Open DevTools with F12 or Ctrl + Shift + I (Cmd + Option + I on Mac) to inspect an element, read the box model, or tweak CSS live.

Doing this dozens of times a day with the keyboard instead of the mouse adds up to real time saved. You can also expose your own shortcuts inside a page with the HTML accesskey attribute, which lets a visitor jump to a link, button, or form field with a key combination.

The shortcuts below are grouped by program and platform:

  • Windows
  • Mac
  • Ubuntu
  • Firefox
  • LibreOffice Writer

Windows and Mac Shortcuts

These tables list the most common shortcuts shared across Windows and macOS applications: general editing, text editing in a document, browsing the web, and taking screenshots. The same keys work in most editors and word processors, so they are a good place to start. For shortcuts that format text in your markup, you may also want to review the HTML tags for text formatting.

Basic Shortcuts

DescriptionWindowsMac OS
Edit menuAlt + ECommand + E
File menuAlt + FCommand + F
View menuAlt + VCommand + V
Select all textCtrl + ACmd + A
Copy textCtrl + CCmd + C
Find textCtrl + FCmd + F
Find and replace textCtrl + HCmd + Option + F
New documentCtrl + NCmd + N
Open a fileCtrl + OCmd + O
Print optionsCtrl + PCmd + P
Save fileCtrl + SCmd + S
Paste textCtrl + VCmd + V
Cut textCtrl + XCmd + X
Redo textCtrl + YShift + Cmd + Z
Undo textCtrl + ZCmd + Z

Text Editing

DescriptionWindowsMac OS
Cursor Movement
Go to right or to beginning of next line breakRight ArrowRight Arrow
Go to left or to end of previous line breakLeft ArrowLeft Arrow
Go up one rowUp ArrowUp Arrow
Go down one rowDown ArrowDown Arrow
Go to beginning of current lineHomeCmd + Left Arrow
Go to end of current lineEndCmd + Right Arrow
Go to beginning of documentCtrl + HomeCmd + Up Arrow
Go to end of documentCtrl + EndCmd + Down Arrow
Move up one framePage UpFn + Up Arrow
Move down one framePage DownFn + Down Arrow
Go to beginning of previous wordCtrl + Left ArrowOption + Left Arrow
Go to beginning of next wordCtrl + Right ArrowOption + Right Arrow
Go to beginning of line breakCtrl + Up ArrowCmd + Left Arrow
Go to end of line breakCtrl + Down ArrowCmd + Right Arrow
Text Selection
Select characters to leftShift + Left ArrowShift + Left Arrow
Select characters to rightShift + Right ArrowShift + Right Arrow
Select lines upwardsShift + Up ArrowShift + Up Arrow
Select lines downwardsShift + Down ArrowShift + Down Arrow
Select words to leftShift + Ctrl + LeftShift + Opt + Left
Select words to rightShift + Ctrl + RightShift + Opt + Right
Select paragraphs to leftShift + Ctrl + UpShift + Opt + Up
Select paragraphs to rightShift + Ctrl + DownShift + Opt + Down
Select text between cursor and the beginning of current lineShift + HomeCmd + Shift + Left Arrow
Select text between cursor and the end of current lineShift + EndCmd + Shift + Right Arrow
Select text between cursor and the beginning of documentShift + Ctrl + HomeCmd + Shift + Up Arrow or Cmd + Shift + Fn + Left Arrow
Select text between cursor and the end of documentShift + Ctrl + EndCmd + Shift + Down Arrow or Cmd + Shift + Fn + Right Arrow
Select one frame when text above the cursorShift + Page UpShift + Fn + Up Arrow
Select one frame when text below the cursorShift + Page DownShift + Fn + Down Arrow
Select all textCtrl + ACmd + A
Find textCtrl + FCmd + F
Text Formatting
Make selected text boldCtrl + BCmd + B
Make selected text italicCtrl + ICmd + I
Underline selected textCtrl + UCmd + U
Make selected text superscriptCtrl + Shift + =Cmd + Shift + =
Make selected text subscriptCtrl + =Cmd + =
Text Editing
Delete characters to leftBackspaceBackspace
Delete characters to rightDeleteDelete
Delete words to leftCtrl + BackspaceCmd + Fn + Backspace
Delete words to rightCtrl + DelCmd + Fn + Delete
IndentTabTab
OutdentShift + TabShift + Tab
Copy textCtrl + CCmd + C
Find and replace textCtrl + HCmd + Option + F
Paste textCtrl + VCmd + V
Cut textCtrl + XCmd + X
Undo textCtrl + ZCmd + Z
Redo textCtrl + YShift + Cmd + Z

Web Browsers

DescriptionWindowsMac OS
Navigation
Scroll down a frameSpace or Page DownSpace or Fn + Down Arrow
Scroll up a frameShift + Space or Page UpShift + Space or Fn + Up Arrow
Go to bottom of the pageEndCmd + Down Arrow
Go to top of the pageHomeCmd + Up Arrow
Go backAlt + Left Arrow or BackspaceCmd + Left Arrow
Go forwardAlt + Right Arrow or Shift + BackspaceCmd + Right Arrow
Refresh webpageF5Cmd + R
Refresh webpage without cacheCtrl + F5Cmd + Shift + R
Stop loadingEscEsc
Toggle full screenF11Cmd + Shift + F
Zoom inCtrl + +Cmd + +
Zoom outCtrl + -Cmd + -
Zoom 100% (default)Ctrl + 0Cmd + 0
Open homepageAlt + HomeOption + Home or Option + Fn + Left Arrow
Find textCtrl + FCmd + F
Developer Tools
Open / close DevToolsF12 or Ctrl + Shift + ICmd + Option + I
Open DevTools at the Inspector (pick an element)Ctrl + Shift + CCmd + Shift + C
Open DevTools at the ConsoleCtrl + Shift + JCmd + Option + J
View page sourceCtrl + UCmd + Option + U
Tab / Window Management
Open a new tabCtrl + TCmd + T
Close current tabCtrl + WCmd + W
Close all tabsCtrl + Shift + WCmd + Shift + W
Go to next tabCtrl + TabControl + Tab or Cmd + Shift + Right Arrow
Go to previous tabCtrl + Shift + TabShift + Control + Tab or Cmd + Shift + Left Arrow
Go to specific tab numberCtrl + 1-8Cmd + 1-8
Go to last tabCtrl + 9Cmd + 9
Re-open the last closed tabCtrl + Shift + TCmd + Shift + T
Open a new windowCtrl + NCmd + N
Close current windowAlt + F4Cmd + W
Go to next windowAlt + TabCmd + Tab
Go to previous windowAlt + Shift + TabCmd + Shift + Tab
Re-open the last closed windowCtrl + Shift + N-
Open links in a new tab in the backgroundCtrl + ClickCmd + Click
Open links in a new tab in the foregroundCtrl + Shift + ClickCmd + Shift + Click
Print current web pageCtrl + PCmd + P
Save current web pageCtrl + SCmd + S
Address Bar
Cycle between toolbar, search bar and page elementsTabTab
Go to browser's address barCtrl + L or Alt + DCmd + L
Focus and select the browser's search barCtrl + ECmd + E or Cmd + K
Open the address bar location in a new tabAlt + EnterOpt + Enter
Display a list of previously typed addressesF4-
Add "www." before and ".com" after the typed text in the address barCtrl + EnterCmd + Enter or Control + Enter
Bookmarks
Open bookmarks menuCtrl + BCmd + B
Add current page to bookmarksCtrl + DCmd + Opt + B or Cmd + Shift + B
Open browsing historyCtrl + HCmd + Shift + H or Cmd + Y
Open download historyCtrl + JCmd + J or Cmd + Shift + J

Screenshots

DescriptionWindowsMac OS
Save whole screen's screenshot as file-Cmd + Shift + 3
Copy whole screen's screenshot to clipboardPrtSc or Ctrl + PrtScCmd + Ctrl + Shift + 3
Save window screenshot as file-Cmd + Shift + 4 + Space
Copy window screenshot to clipboardAlt + PrtScCmd + Ctrl + Shift + 4 + Space
Copy a wanted area's screenshot to clipboard-Cmd + Ctrl + Shift + 4
Save a wanted area's screenshot as file-Cmd + Shift + 4

Ubuntu Shortcuts

Besides Windows and macOS, Ubuntu has its own set of shortcuts. The Super key (the key with the Windows logo on most keyboards) is the main modifier for desktop and window actions.

Note: Most of the tables in this section describe the older Unity/Compiz desktop that shipped with Ubuntu before 17.10. Unity was retired as the default in October 2017, and modern Ubuntu uses the GNOME desktop, where several of these keys behave differently or do nothing at all. The current GNOME shortcuts are listed first; the legacy Unity/Compiz tables follow them and are kept only for reference on older systems.

Modern GNOME (current Ubuntu)

DescriptionShortcut
Open the Activities overviewSuper
Open the application gridSuper + A
Switch between open applicationsAlt + Tab
Switch between open applications (same as Alt + Tab)Super + Tab
Switch between windows of the same appSuper + `
Show the desktop (minimize all)Super + D
Switch to the workspace above / belowSuper + Page Up / Page Down
Take a screenshot (screenshot tool)PrtSc

Legacy Unity/Compiz desktop

Legacy: The tables below describe the Unity desktop and its Compiz "Desktop Effects" (the spinning workspace cube and similar). These were removed from default Ubuntu in 2017 and will not work on a modern GNOME install. They are kept here for users still running older releases.

Desktop Shortcuts

DescriptionShortcut
Open the applications menuAlt + F1
Run an application by typing its name in the box which appearsAlt + F2
Take a screenshot of the whole screenPrtSc (Print Screen)
Take a screenshot of the current windowAlt + PrtSc
Take a screenshot of a selected areaShift + PrtSc

Window Shortcuts

DescriptionShortcut
Switch between currently open windows. Press Alt + Tab and release Tab (hold Alt), then press Tab repeatedly to cycle through the list. Release Alt to switch.Alt + Tab
Switch between currently-open windows in all Workspaces. Press Tab repeatedly to cycle through the list. Release Ctrl and Alt to switch.Ctrl + Alt + Tab
Quickly switch between your Workspaces.Ctrl + Alt + Left or Right Cursor
Moves the current window (can be moved with mouse or keyboard). May not work on every device.Alt + F7
Resizes current window (can be resized with mouse or keyboard). May not work on every device.Alt + F8
Minimises current window. May not work on every device.Alt + F9
Maximises current window. May not work on every device.Alt + F10
Brings up window menu with 'Always on Top', 'Minimise', 'Maximise', and above commands. May not work on every device.Alt + Space
Returns window to 'normal' or previous size. May not work on every application.Alt + F5
Closes window. May not work on every application.Alt + F4

Desktop Effects enabled shortcuts

These shortcuts only work when the Compiz "Desktop Effects" are enabled — a feature of the old Unity desktop. Modern GNOME does not provide the spinning workspace cube or these effects, so these keys will have no effect there.

DescriptionShortcut
Spins the 'cube' that your workspaces reside on, allowing you to select the workspace you wish to use.Ctrl + Alt + Left or Right Cursor
Enables an 'expose' like feature that presents you with all the windows you currently have open, allowing you to select the one you wish to give focus to.Ctrl + Alt + Up Cursor
Unfolds your workspace cube allowing you to see more than one of your workspaces at once, using the left and right cursor keys with this active will allow you to select the workspace you wish to use.Ctrl + Alt + Down Cursor
Switch between currently-open windows across all workspaces.Ctrl + Alt + Tab
Enables the 'scale' effect, it shows all windows from the current workspace.Super + W
Enables the 'scale' effect, it shows all windows from all workspaces.Super + A
Invert colours of the focused window.Super + N
Invert colours for the whole screen.Super + M
Zooms in on the screen.Super + Mouse Scroll Wheel
Select a region to zoom into, using a rectangle.Super + Middle Mouse Button
Toggles 'Show Desktop'.Ctrl + Super + D
Resize focused window.Alt + Middle Mouse Button
Move focused window.Alt + Left Mouse Button
Show window menu.Alt + Right Mouse Button
Zoom out, show workspace switcher.Super + S

Common Application Shortcuts

These shortcuts are commonly used, but they may not work in every application.

DescriptionShortcut
Copy the selected text/objectCtrl + C
Cut the selected text/objectCtrl + X
Paste/insert the selected text/objectCtrl + V
Select all textCtrl + A
Make the selected text boldCtrl + B
Make the selected text italicCtrl + I
Underline the selected textCtrl + U
Open a new document or windowCtrl + N
Save the current documentCtrl + S
Open another documentCtrl + O
Print the current documentCtrl + P
Undo the last change you madeCtrl + Z
Redo a change that you just undidCtrl + Shift + Z

System Shortcuts

DescriptionShortcut
Open Windows Security screen (includes restart option)Ctrl + Alt + Delete
Rotate screen orientation (Intel Graphics only)Ctrl + Alt + Plus (Numeric Keypad)
Rotate backwards through supported screen orientations (Intel Graphics only)Ctrl + Alt + Minus (Numeric Keypad)

Application-specific Shortcuts

Individual applications add their own shortcuts on top of the system-wide ones. Two programs developers and writers use most are the Mozilla Firefox browser and the LibreOffice Writer word processor. Their key combinations are listed below.

Mozilla Firefox

DescriptionShortcut
Open a new tabCtrl + T
Rotate through each tabCtrl + Tab
Rotate backwards through each tabCtrl + Shift + Tab
Close the current tab (or browser if on last tab)Ctrl + W
Enter a new web addressCtrl + L
Show a list of your bookmarksCtrl + B
Show your browsing historyCtrl + H
Enter a new web search in the search barCtrl + K
Show a list of downloaded filesCtrl + J
Display the current page full-screenF11
Stop loading the current pageEsc
Reload the current pageCtrl + R
Scrolls current tab/window down.Page Down
Scrolls current tab/window up.Page Up

LibreOffice Writer

DescriptionShortcut
Check the spelling of the current documentF7
Find textCtrl + F
Find and replace wordsCtrl + H
Undo the last changeCtrl + Z
Redo a change which you just undidCtrl + Y
Align the current paragraph/selection to the leftCtrl + L
Align the current paragraph/selection to the center of the documentCtrl + E
Align the current paragraph/selection to the rightCtrl + R
Open the Styles panel (Styles & Formatting)F11
Show the current document full-screenCtrl + Shift + J

Customizing shortcuts

Most of the keys above are defaults, and many programs let you change them. In LibreOffice, for example, you can remap any shortcut from the menu at Tools ▸ Customize… ▸ Keyboard. Browsers and code editors offer similar settings, so if a default combination clashes with another tool you use, you can usually reassign it.

Practice

Practice
Based on the shortcuts on this page, which of the following are correct?
Based on the shortcuts on this page, which of the following are correct?
Was this page helpful?