VS Code snippet generator

Plain code in.
Snippet out.

Paste your code, give it a name and prefix, and get a ready-to-use VS Code snippet file. Everything runs locally in your browser.

Runs locally No sign-up Ready for VS Code

Snippet details

These become the keys and values in your snippet file.

VS Code JSON

Turn this off to treat every $ as literal text.

Your code

1 line · 0 characters Tab inserts 2 spaces

greeting-function.code-snippets


              
Nothing to convert yet Paste some code to see the snippet.
Ready to copy or download. Ctrl/⌘ + Enter to copy

Your code never leaves this page. Conversion runs locally in your browser.

How it works

From clipboard to command palette.

  1. Paste your code

    Drop in a function, a config block, or any plain text. Line breaks and indentation are preserved.

  2. Describe the snippet

    Choose a name, the prefix you will type in VS Code, and an optional language scope.

  3. Copy or download

    Paste the JSON into your user snippets, or save the .code-snippets file and keep it with your setup.

In VS Code, open the Command Palette and run Preferences: Configure User Snippets to add it.

FAQ

Good to know.

Short answers about snippet files, dollar signs, and prefixes.

Where do I put the generated file?

Save the downloaded .code-snippets file in your VS Code snippets folder, or open the Command Palette and run Preferences: Configure User Snippets. You can paste the JSON into an existing snippet file as well.

Why is my dollar sign escaped?

VS Code uses $ for tab stops and variables. The converter escapes dollars that are not snippet syntax, so code such as $('.item') or ${name} stays intact. Turn off “Keep placeholders” to escape every dollar sign.

What is a prefix?

The prefix is the shortcut you type in the editor to insert the snippet. For example, a prefix of greet lets you type greet, press Tab, and expand the snippet.

Is my code uploaded anywhere?

No. There is no server, account, or analytics. The conversion runs entirely in this browser tab.