How to Zoom in and out in Visual Studio Code

avatar
Borislav Hadzhiev

Last updated: Apr 6, 2024
4 min

banner

# Table of Contents

  1. Zoom in and out in VS Code using keyboard shortcuts
  2. Zoom in and out in VS Code using the Command Palette
  3. Changing the keyboard shortcuts for zooming in and out
  4. Enable Mouse Wheel zoom in Visual Studio Code
  5. Enabling Mouse Wheel Zoom in settings.json
  6. Zooming in and out using the top menu in VS Code

# Zoom in and out in VS Code using keyboard shortcuts

Use the following keyboard shortcuts to zoom in and out in VS Code:

  • Ctrl + = ( or Cmd + = on macOS) to zoom in.
  • Ctrl + - ( or Cmd + - on macOS) to zoom out.
  • Ctrl + Numpad0 (or Cmd + Numpad0 on macOS) to reset the zoom level to 0.

zoom in and out

You can also view the keyboard shortcuts for your operating system in this table in the docs.

The commands are called:

  • Zoom in
  • Zoom out
  • Reset Zoom

# Zoom in and out in VS Code using the Command Palette

You can also use the Command Palette.

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Zoom and select one of:
  • Editor Font Zoom In
  • Editor Font Zoom Out
  • Editor Font Zoom Reset

zoom in out using command palette

Using the Editor Font Zoom Reset command via the Command Palette is quite convenient if your keyboard doesn't have a Numpad.

# Changing the keyboard shortcuts for zooming in and out

If you need to change the keyboard shortcuts for zooming in and out:

  1. Press:
  • Ctrl + Shift + P on Windows and Linux.
  • Command + Shift + P on macOS.
Note: you can also press F1 to open the Command Palette.
  1. Type Keyboard Shortcuts and select Preferences: Open Keyboard Shortcuts.

preferences open keyboard shortcuts

  1. Search for zoom.

set custom keyboard shortcuts zoom

  1. Double-click on the corresponding row, specify a keyboard shortcut and hit Enter to confirm.

You can also single-clock on a row and then click on the pencil icon.

For example, if your keyboard shortcut doesn't have a Numpad, you can set the View: Reset Zoom command to Ctrl + 0 (or Cmd + 0 on macOS).

change reset zoom keyboard shortcut

Here is a short clip of using the new keyboard shortcut.

using custom keyboard shortcuts to zoom

# Enable Mouse Wheel zoom in Visual Studio Code

When you use the keyboard shortcuts, you increase/decrease the editor and the font.

If you only want to increase/decrease the font when zooming in and out, you have to enable the Mouse Wheel Zoom setting.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings and select Preferences: Open User Settings.

open user settings

You can also open the settings screen by pressing Ctrl + , on Windows and Linux or Cmd + , on macOS.

  1. Type zoom and enable the Editor: Mouse Wheel Zoom setting.

enable mouse wheel zoom

The Mouse Wheel Zoom setting allows us to zoom the font of the editor using the mouse wheel and holding Ctrl (or Cmd on macOS).

using mouse wheel zoom

Hold Ctrl and use the mouse wheel to zoom in and out.

Notice that using mouse wheel zoom affects only the font of the editor.

# Enabling Mouse Wheel Zoom in settings.json

You can also enable mouse wheel zoom directly in your settings.json file.

  1. Press Ctrl + Shift + P (or Command + Shift + P on macOS).
Note: you can also press F1 to open the Command Palette.
  1. Type user settings json.

  2. Click on Preferences: Open User Settings (JSON)

preferences open user settings

  1. Paste the following line into your settings.json file.
settings.json
"editor.mouseWheelZoom": true,

enable mouse wheel zoom in settings json

# Zooming in and out using the top menu in VS Code

You can also use the top menu to zoom in and out.

  1. Click on View in the top menu, then hover over Appearance and select one of Zoom in, Zoom Out and Reset Zoom.

  2. Note: you might have to press Alt to show the top menu on Windows and Linux.

zoom in and out using top menu

# Additional Resources

You can learn more about the related topics by checking out the following tutorials:

I wrote a book in which I share everything I know about how to become a better, more efficient programmer.
book cover
You can use the search field on my Home Page to filter through all of my articles.