WindowsmacOSLinux

Where Does VS Code Store Snippets?

VS Code keeps code snippets as JSON files in a snippets folder under User. Paths per OS and per language files.

Last updated

Settings and extensions have their own post. This one covers snippets: small JSON files per language that expand prefixes into boilerplate. They live in a snippets folder inside User.

Each language gets its own file with prefix, body and description entries. The palette command names the right file so nothing needs memorizing. Settings Sync carries them when signed in.

Where Visual Studio Code stores this, by platform

Windows
%APPDATA%\Code\User\snippets

One JSON file per language plus global code-snippets files. Open them from inside VS Code with Preferences Configure Snippets. Extensions add their own bundles elsewhere.

macOS
~/Library/Application Support/Code/User/snippets

Same interior as Windows. Sync covers these files when signed in, so manual copies matter mainly for offline moves.

Linux
~/.config/Code/User/snippets

Identical layout on Linux under config home. Portable builds keep the User tree beside the app folder instead.

Frequently asked questions

How do I create a snippet file?

Open the Command Palette and run Preferences Configure Snippets, then pick a language. That creates or opens the right JSON file in the snippets folder. The file name matches the language id, so python.json holds Python snippets.

How do I back up snippets?

Copy the whole snippets folder with VS Code quit. Every language file travels together. Global snippets sit in a code-snippets file beside them while project ones belong in .vscode folders per repo.

Notice an outdated path? Let us know.