Home / Configs / Developer tools / VS Code settings.json

VS Code settings.json example: font, tabs and format on save

Set font, tab size, format on save and theme in your VS Code settings.

For Visual Studio Code on Windows, macOS and Linux. The steps open the right file for you.

VS Code stores your editor preferences in settings.json. Choose your options below to get the lines you need, then paste them into your user settings.

Create your config file

Type your own values. The file below updates as you type, and nothing you type leaves your browser.

Must be installed on your computer

settings.json
{
  "editor.fontSize": 14,
  "editor.fontFamily": "Consolas, 'Courier New', monospace",
  "editor.tabSize": 2,
  "editor.formatOnSave": true,
  "editor.wordWrap": "off",
  "editor.minimap.enabled": false,
  "files.autoSave": "afterDelay",
  "workbench.colorTheme": "Default Dark Modern",
  "files.trimTrailingWhitespace": true
}

How this setup works

Diagram: settings.json, then VS Code, then Every project
settings.json (your choices) → VS Code (applies on save) → Every project (same setup)

Step-by-step setup

  1. Press Ctrl+Shift+P (Mac: Cmd+Shift+P) and run Preferences: Open User Settings (JSON).
  2. If the file already has settings, do not replace them. Copy only the lines you want inside the existing braces.
  3. Save the file. VS Code applies it at once.
  4. For format on save, install a formatter such as Prettier.

What the important lines mean

Common errors and how to fix them

The font does not change
Install the font from your list, for example Consolas, 'Courier New', monospace, then restart VS Code.
Format on save does nothing
Install a formatter extension such as Prettier and set it as the default formatter for that file type.
Expected comma
When merging, every line inside the braces needs a comma except the last one.

Frequently asked questions

How do I open settings.json in VS Code?
Press Ctrl+Shift+P (Cmd+Shift+P on a Mac) and run "Preferences: Open User Settings (JSON)".
How do I turn on format on save?
Set "editor.formatOnSave": true and install a formatter such as Prettier. The option does nothing without a formatter.
Should I replace my whole settings.json?
No. Copy only the lines you want into the existing braces, and keep a comma after each line except the last.

Written for: VS Code 1.9x, Windows 11, macOS 14, Ubuntu 24.04 · Updated 2026-10-02

More developer configs

See all 41 config generators