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:
- Edit the markup in your editor, then Ctrl + S (Cmd + S on Mac) to save.
- Switch to the browser window with Alt + Tab (Cmd + Tab on Mac).
- 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).
- 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
| Description | Windows | Mac OS |
|---|---|---|
| Edit menu | Alt + E | Command + E |
| File menu | Alt + F | Command + F |
| View menu | Alt + V | Command + V |
| Select all text | Ctrl + A | Cmd + A |
| Copy text | Ctrl + C | Cmd + C |
| Find text | Ctrl + F | Cmd + F |
| Find and replace text | Ctrl + H | Cmd + Option + F |
| New document | Ctrl + N | Cmd + N |
| Open a file | Ctrl + O | Cmd + O |
| Print options | Ctrl + P | Cmd + P |
| Save file | Ctrl + S | Cmd + S |
| Paste text | Ctrl + V | Cmd + V |
| Cut text | Ctrl + X | Cmd + X |
| Redo text | Ctrl + Y | Shift + Cmd + Z |
| Undo text | Ctrl + Z | Cmd + Z |
Text Editing
| Description | Windows | Mac OS |
|---|---|---|
| Cursor Movement | ||
| Go to right or to beginning of next line break | Right Arrow | Right Arrow |
| Go to left or to end of previous line break | Left Arrow | Left Arrow |
| Go up one row | Up Arrow | Up Arrow |
| Go down one row | Down Arrow | Down Arrow |
| Go to beginning of current line | Home | Cmd + Left Arrow |
| Go to end of current line | End | Cmd + Right Arrow |
| Go to beginning of document | Ctrl + Home | Cmd + Up Arrow |
| Go to end of document | Ctrl + End | Cmd + Down Arrow |
| Move up one frame | Page Up | Fn + Up Arrow |
| Move down one frame | Page Down | Fn + Down Arrow |
| Go to beginning of previous word | Ctrl + Left Arrow | Option + Left Arrow |
| Go to beginning of next word | Ctrl + Right Arrow | Option + Right Arrow |
| Go to beginning of line break | Ctrl + Up Arrow | Cmd + Left Arrow |
| Go to end of line break | Ctrl + Down Arrow | Cmd + Right Arrow |
| Text Selection | ||
| Select characters to left | Shift + Left Arrow | Shift + Left Arrow |
| Select characters to right | Shift + Right Arrow | Shift + Right Arrow |
| Select lines upwards | Shift + Up Arrow | Shift + Up Arrow |
| Select lines downwards | Shift + Down Arrow | Shift + Down Arrow |
| Select words to left | Shift + Ctrl + Left | Shift + Opt + Left |
| Select words to right | Shift + Ctrl + Right | Shift + Opt + Right |
| Select paragraphs to left | Shift + Ctrl + Up | Shift + Opt + Up |
| Select paragraphs to right | Shift + Ctrl + Down | Shift + Opt + Down |
| Select text between cursor and the beginning of current line | Shift + Home | Cmd + Shift + Left Arrow |
| Select text between cursor and the end of current line | Shift + End | Cmd + Shift + Right Arrow |
| Select text between cursor and the beginning of document | Shift + Ctrl + Home | Cmd + Shift + Up Arrow or Cmd + Shift + Fn + Left Arrow |
| Select text between cursor and the end of document | Shift + Ctrl + End | Cmd + Shift + Down Arrow or Cmd + Shift + Fn + Right Arrow |
| Select one frame when text above the cursor | Shift + Page Up | Shift + Fn + Up Arrow |
| Select one frame when text below the cursor | Shift + Page Down | Shift + Fn + Down Arrow |
| Select all text | Ctrl + A | Cmd + A |
| Find text | Ctrl + F | Cmd + F |
| Text Formatting | ||
| Make selected text bold | Ctrl + B | Cmd + B |
| Make selected text italic | Ctrl + I | Cmd + I |
| Underline selected text | Ctrl + U | Cmd + U |
| Make selected text superscript | Ctrl + Shift + = | Cmd + Shift + = |
| Make selected text subscript | Ctrl + = | Cmd + = |
| Text Editing | ||
| Delete characters to left | Backspace | Backspace |
| Delete characters to right | Delete | Delete |
| Delete words to left | Ctrl + Backspace | Cmd + Fn + Backspace |
| Delete words to right | Ctrl + Del | Cmd + Fn + Delete |
| Indent | Tab | Tab |
| Outdent | Shift + Tab | Shift + Tab |
| Copy text | Ctrl + C | Cmd + C |
| Find and replace text | Ctrl + H | Cmd + Option + F |
| Paste text | Ctrl + V | Cmd + V |
| Cut text | Ctrl + X | Cmd + X |
| Undo text | Ctrl + Z | Cmd + Z |
| Redo text | Ctrl + Y | Shift + Cmd + Z |
Web Browsers
| Description | Windows | Mac OS |
|---|---|---|
| Navigation | ||
| Scroll down a frame | Space or Page Down | Space or Fn + Down Arrow |
| Scroll up a frame | Shift + Space or Page Up | Shift + Space or Fn + Up Arrow |
| Go to bottom of the page | End | Cmd + Down Arrow |
| Go to top of the page | Home | Cmd + Up Arrow |
| Go back | Alt + Left Arrow or Backspace | Cmd + Left Arrow |
| Go forward | Alt + Right Arrow or Shift + Backspace | Cmd + Right Arrow |
| Refresh webpage | F5 | Cmd + R |
| Refresh webpage without cache | Ctrl + F5 | Cmd + Shift + R |
| Stop loading | Esc | Esc |
| Toggle full screen | F11 | Cmd + Shift + F |
| Zoom in | Ctrl + + | Cmd + + |
| Zoom out | Ctrl + - | Cmd + - |
| Zoom 100% (default) | Ctrl + 0 | Cmd + 0 |
| Open homepage | Alt + Home | Option + Home or Option + Fn + Left Arrow |
| Find text | Ctrl + F | Cmd + F |
| Developer Tools | ||
| Open / close DevTools | F12 or Ctrl + Shift + I | Cmd + Option + I |
| Open DevTools at the Inspector (pick an element) | Ctrl + Shift + C | Cmd + Shift + C |
| Open DevTools at the Console | Ctrl + Shift + J | Cmd + Option + J |
| View page source | Ctrl + U | Cmd + Option + U |
| Tab / Window Management | ||
| Open a new tab | Ctrl + T | Cmd + T |
| Close current tab | Ctrl + W | Cmd + W |
| Close all tabs | Ctrl + Shift + W | Cmd + Shift + W |
| Go to next tab | Ctrl + Tab | Control + Tab or Cmd + Shift + Right Arrow |
| Go to previous tab | Ctrl + Shift + Tab | Shift + Control + Tab or Cmd + Shift + Left Arrow |
| Go to specific tab number | Ctrl + 1-8 | Cmd + 1-8 |
| Go to last tab | Ctrl + 9 | Cmd + 9 |
| Re-open the last closed tab | Ctrl + Shift + T | Cmd + Shift + T |
| Open a new window | Ctrl + N | Cmd + N |
| Close current window | Alt + F4 | Cmd + W |
| Go to next window | Alt + Tab | Cmd + Tab |
| Go to previous window | Alt + Shift + Tab | Cmd + Shift + Tab |
| Re-open the last closed window | Ctrl + Shift + N | - |
| Open links in a new tab in the background | Ctrl + Click | Cmd + Click |
| Open links in a new tab in the foreground | Ctrl + Shift + Click | Cmd + Shift + Click |
| Print current web page | Ctrl + P | Cmd + P |
| Save current web page | Ctrl + S | Cmd + S |
| Address Bar | ||
| Cycle between toolbar, search bar and page elements | Tab | Tab |
| Go to browser's address bar | Ctrl + L or Alt + D | Cmd + L |
| Focus and select the browser's search bar | Ctrl + E | Cmd + E or Cmd + K |
| Open the address bar location in a new tab | Alt + Enter | Opt + Enter |
| Display a list of previously typed addresses | F4 | - |
| Add "www." before and ".com" after the typed text in the address bar | Ctrl + Enter | Cmd + Enter or Control + Enter |
| Bookmarks | ||
| Open bookmarks menu | Ctrl + B | Cmd + B |
| Add current page to bookmarks | Ctrl + D | Cmd + Opt + B or Cmd + Shift + B |
| Open browsing history | Ctrl + H | Cmd + Shift + H or Cmd + Y |
| Open download history | Ctrl + J | Cmd + J or Cmd + Shift + J |
Screenshots
| Description | Windows | Mac OS |
|---|---|---|
| Save whole screen's screenshot as file | - | Cmd + Shift + 3 |
| Copy whole screen's screenshot to clipboard | PrtSc or Ctrl + PrtSc | Cmd + Ctrl + Shift + 3 |
| Save window screenshot as file | - | Cmd + Shift + 4 + Space |
| Copy window screenshot to clipboard | Alt + PrtSc | Cmd + 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)
| Description | Shortcut |
|---|---|
| Open the Activities overview | Super |
| Open the application grid | Super + A |
| Switch between open applications | Alt + Tab |
| Switch between open applications (same as Alt + Tab) | Super + Tab |
| Switch between windows of the same app | Super + ` |
| Show the desktop (minimize all) | Super + D |
| Switch to the workspace above / below | Super + 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
| Description | Shortcut |
|---|---|
| Open the applications menu | Alt + F1 |
| Run an application by typing its name in the box which appears | Alt + F2 |
| Take a screenshot of the whole screen | PrtSc (Print Screen) |
| Take a screenshot of the current window | Alt + PrtSc |
| Take a screenshot of a selected area | Shift + PrtSc |
Window Shortcuts
| Description | Shortcut |
|---|---|
| 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.
| Description | Shortcut |
|---|---|
| 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.
| Description | Shortcut |
|---|---|
| Copy the selected text/object | Ctrl + C |
| Cut the selected text/object | Ctrl + X |
| Paste/insert the selected text/object | Ctrl + V |
| Select all text | Ctrl + A |
| Make the selected text bold | Ctrl + B |
| Make the selected text italic | Ctrl + I |
| Underline the selected text | Ctrl + U |
| Open a new document or window | Ctrl + N |
| Save the current document | Ctrl + S |
| Open another document | Ctrl + O |
| Print the current document | Ctrl + P |
| Undo the last change you made | Ctrl + Z |
| Redo a change that you just undid | Ctrl + Shift + Z |
System Shortcuts
| Description | Shortcut |
|---|---|
| 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
| Description | Shortcut |
|---|---|
| Open a new tab | Ctrl + T |
| Rotate through each tab | Ctrl + Tab |
| Rotate backwards through each tab | Ctrl + Shift + Tab |
| Close the current tab (or browser if on last tab) | Ctrl + W |
| Enter a new web address | Ctrl + L |
| Show a list of your bookmarks | Ctrl + B |
| Show your browsing history | Ctrl + H |
| Enter a new web search in the search bar | Ctrl + K |
| Show a list of downloaded files | Ctrl + J |
| Display the current page full-screen | F11 |
| Stop loading the current page | Esc |
| Reload the current page | Ctrl + R |
| Scrolls current tab/window down. | Page Down |
| Scrolls current tab/window up. | Page Up |
LibreOffice Writer
| Description | Shortcut |
|---|---|
| Check the spelling of the current document | F7 |
| Find text | Ctrl + F |
| Find and replace words | Ctrl + H |
| Undo the last change | Ctrl + Z |
| Redo a change which you just undid | Ctrl + Y |
| Align the current paragraph/selection to the left | Ctrl + L |
| Align the current paragraph/selection to the center of the document | Ctrl + E |
| Align the current paragraph/selection to the right | Ctrl + R |
| Open the Styles panel (Styles & Formatting) | F11 |
| Show the current document full-screen | Ctrl + 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.
Related chapters
- HTML editors — choosing a code editor to write your markup in
- HTML tags for text formatting — the bold, italic, and other tags the formatting shortcuts apply to
- HTML accesskey attribute — defining your own keyboard shortcuts for elements on a web page
- HTML introduction — start here if you are new to HTML