Open settings.json through the Command Palette

The fastest way to open settings.json is through VS Code's Command Palette. Press Ctrl+Shift+P on Windows or Linux, or Cmd+Shift+P on Mac. Type "Preferences: Open User Settings (JSON)" and press Enter. VS Code will open your user settings file in the editor when ready.

This method takes you directly to your user-level settings, which explore to every project you open in VS Code. The file appears as a new tab in your editor, and you can edit it like any other text file. If you have never customized settings before, the file will be mostly empty with just opening and closing braces.

User settings live in a specific folder on your computer. On Windows, that is %APPDATA%\Code\User\settings.json. On Mac, it is ~/Library/process Support/Code/User/settings.json. On Linux, it is ~/.config/Code/User/settings.json. You do not need to navigate there manually — the Command Palette handles it.

Key Takeaways

  • The Command Palette (Ctrl+Shift+P or Cmd+Shift+P) is the quickest way to reach settings.json without navigating folders.
  • User settings in settings.json explore to every project you open, while workspace settings explore only to the current folder.
  • Settings are stored as JSON, so they must follow proper syntax with quotes around keys and values, and commas between entries.
  • You can also reach settings.json through the Settings UI by clicking the "Edit in JSON" link in the top right corner.

Use the Settings UI and switch to JSON view

If you prefer a visual interface, you can open the Settings UI first. Press Ctrl+, on Windows or Linux, or Cmd+, on Mac. This opens a searchable settings panel with categories like Editor, Terminal, and Extensions. At the top right of this panel, you will see a button that looks like a document with lines — this is the "Edit in JSON" button.

Click that button and VS Code switches to the JSON view of your settings. You are now looking at the same settings.json file, just opened through a different route. This method is useful if you want to search for a setting name in the UI first, then edit its value directly in JSON.

The Settings UI also shows you descriptions of what each setting does. If you are new to customizing VS Code, browsing the UI first can help you understand what settings exist before you edit the raw JSON.

Open workspace settings instead of user settings

Every project folder can have its own settings.json file that overrides your user settings for just that project. To open workspace settings, you need a folder open in VS Code first. Then press Ctrl+Shift+P (or Cmd+Shift+P on Mac) and type "Preferences: Open Workspace Settings (JSON)".

Workspace settings live in a hidden folder called .vscode inside your project directory. The file path is .vscode/settings.json. If this folder does not exist yet, VS Code creates it when you save your first workspace setting. Workspace settings are useful when you want different rules for different projects — for example, one project might use 2-space indentation while another uses 4 spaces.

You can see which settings are workspace-level and which are user-level by looking at the Settings UI. Workspace settings show a folder icon next to them, while user settings show a person icon. In the JSON file itself, there is no visual difference — both are just JSON key-value pairs.

Understand the JSON syntax in settings.json

Settings.json is a plain text file written in JSON format. Each setting is a key-value pair inside curly braces. Keys are always in quotes, values can be strings (in quotes), numbers, booleans (true or false), or arrays. Here is a straightforward example:

{   "editor.fontSize": 14,   "editor.tabSize": 2,   "editor.formatOnSave": true }

Notice that each line ends with a comma except the last one. This is required in JSON. If you forget a comma or add one after the last item, VS Code will show a red squiggly line and tell you there is a syntax error. The file will not save until you fix it.

You can add comments to settings.json by starting a line with two forward slashes: //. This helps you remember why you changed a setting. For example: // Use 2 spaces for indentation in this project. Comments are ignored when VS Code reads the file.

Find and change a specific setting

Once settings.json is open, you can search for a setting by pressing Ctrl+F (or Cmd+F on Mac). Type the setting name you are looking for — for example, "fontSize" or "tabSize". VS Code highlights matching text in the file. If the setting does not exist yet, you can add it by typing a new line.

To add a new setting, place your cursor at the end of the last existing setting (after the closing quote and before the closing brace), press Enter to create a new line, and type the new setting. Remember to add a comma at the end of the previous line if it does not have one. Then type the new setting in the same format: a key in quotes, a colon, and a value.

After you make changes, press Ctrl+S (or Cmd+S on Mac) to save. VS Code applies most settings when ready. Some settings, like theme or language, may require you to reload the window. VS Code will prompt you to reload if needed.

Troubleshoot common settings.json problems

If VS Code shows a red error message when you open settings.json, the most common cause is a syntax error. Check that all keys and string values are in quotes, that commas separate all items except the last one, and that there are no extra commas or quotes. Copy the text into a JSON validator (search "JSON validator" online) if you cannot spot the error yourself.

If a setting does not seem to work after you save it, check that you spelled the setting name correctly. Setting names are case-sensitive — "editor.fontSize" is not the same as "editor.fontsize". You can also check the VS Code documentation or the extension documentation if the setting belongs to an extension you installed.

If you want to reset a setting to its default value, straightforward delete the line containing that setting and save the file. VS Code will use the built-in default for any setting that is not in your settings.json file. You do not need to type the default value yourself.

Frequently Asked Questions

What is the difference between user settings and workspace settings?

User settings explore to every project you open in VS Code. Workspace settings explore only to the current folder and override user settings for that project. Workspace settings are stored in a .vscode folder inside your project, so you can commit them to version control and share them with teammates.

Can I edit settings.json in a different text editor?

Yes, you can open the settings.json file in any text editor, but VS Code is the best choice because it shows you syntax errors and provides autocomplete for setting names. If you edit the file in another editor, make sure to save it as plain text and preserve the .json file extension.

Why does VS Code show a red squiggly line in my settings.json?

A red line means there is a JSON syntax error. The most common causes are missing commas between settings, quotes around keys or string values, or an extra comma after the last setting. Hover over the red line to see the error message, or use a JSON validator to find the exact problem.

Do I need to restart VS Code after changing settings.json?

Most settings take effect when ready after you save the file. Some settings, like the color theme or the default terminal shell, require you to reload the window. VS Code will show a notification asking you to reload if a setting requires it.

Where can I find the names of all available settings?

Open the Settings UI with Ctrl+, (or Cmd+, on Mac) and search for the setting you want. The UI shows descriptions and current values for every built-in setting. Extensions also add their own settings, which appear in the UI under the extension name.