How to Change Tab Size in VSCode for macOS and Windows?

Published Apr 26, 2022  ∙  Updated May 2, 2022

How can we change our VSCode indentation, or tab size?

Some of us prefer 2 spaces, while others may prefer 4 spaces.

Open Settings

First, let’s open VSCode’s Settings.

  • On macOS, this will be under CodePreferencesSettings.
    • We can also use the macOS shortcut: ⌘ + ,
  • On Windows, this will be under FilePreferencesSettings.
    • We can also use the Windows shortcut: Ctrl + ,

Search for tab size

Under Search settings, let’s search for tab size.

We should see a result for Editor: Tab Size.

There, we can set the number of spaces that a tab should be equivalent to.

The settings should be applied immediately.