Kinda Code
Home/VS Code/VS Code: How To Change Indentation (2 spaces, 4 spaces)

VS Code: How To Change Indentation (2 spaces, 4 spaces)

Last updated: September 01, 2023

This short and straight-to-the-point article shows you how to change the indentation in VS Code (Visual Studio Code).

1. Open your VS Code and:

  • Go to Code > Settings (or Preferences) > Settings if you’re using macOS (shortcut: Command + ,).
  • Go to File > Preferences > Settings if you’re using Windows (hotkey: Ctrl + ,).

Here’s the screenshot on Mac:

2. Type “Indentation” into the search field then head to the “Editor: Tab Size” section. Replace the default space number with your preferred one:

Your setting will be applied and reflected immediately. If this doesn’t happen (it’s a little lag sometimes), just reload or restart your VS Code.

Further reading:

You can also check out our Visual Studio Code topic page for more tips and tricks to improve your producibility and coding experience. Happy coding!

Related Articles