Understanding JSONC Mode
VS Code has introduced a new JSONC mode, which allows comments in JSON files. This feature is intentional and different from the standard JSON format. Here’s a guide to understanding and using this mode effectively.
Your Settings File and Comments
Your settings. json file is a vital part of your development environment. It’s full of notes to yourself, explaining why certain settings are enabled. However, when you hand this file to Python’s built-in JSON parser, it fails on the very first comment. Since version 1. 19 in November 2017, VS Code has opened its own config files in a separate mode that allows comments on purpose.
The JSON Standard
JSON, short for JavaScript Object Notation, is a plain-text format used by countless apps and websites to pass data around. Its official standard, RFC 8259, allows objects, arrays, strings, numbers, true, false, and null. It doesn’t allow comments and it doesn’t allow a trailing comma, the extra comma after the last item in a list.
Config Files and Comments
Config files like settings. json, and tsconfig. json are something you return to months later. A one-line note explaining why you enabled a setting can help you remember that context. VS Code’s settings. json file is full of such notes, and it includes line comments, block comments, and trailing commas. However, VS Code’s JSONC mode allows these comments, making it easier to remember why certain settings are enabled.
The switch to JSONC mode lives in the bottom-right corner of the status bar. Open a regular. json file, and the language indicator reads JSON. Open settings. json, and it reads JSON with Comments, usually shortened to JSONC. That one label decides which rules the editor enforces.
To see the difference, you can save the same config file twice, once as app-config. json and once as app-config. json copy will show four errors, while the. jsonc copy will show only two yellow warnings. Those warnings are interesting. jsonc file, VS Code flags trailing commas as warnings, matching its documentation, which calls them discouraged. json, the same commas pass silently. VS Code recognizes these files and relaxes the rules even further.
Strict Parsers and Comments
Strict parsers won’t forgive those comments. The leniency stops the moment a file leaves VS Code. Point a short Python script at app-config. jsonc, using the built-in json module that follows the official standard. It fails immediately with a JSONDecodeError at line 2, column 3, the exact spot where the first comment begins. Windows PowerShell’s ConvertFrom-Json command also rejected the file.
Conclusion
In practice, this comes down to two habits. Comment freely in files labeled JSON with Comments, and strip those comments before a file goes to a script, an API, or another app. Treat comments as a config-file privilege. Annotate freely, but check the status bar first.
JSONC looks set to outlast its reputation as a VS Code quirk. A community specification has been in draft since September 2025, which suggests other tools may eventually agree on the same rules. Until then, treat comments as a privilege that comes with config files. Record why you changed a setting, keep your data files strict, and glance at the language mode before copying a config anywhere else.
The rule-breaking works because it’s deliberate and contained. And once your settings file is tidy, the VS Code extensions worth installing early are a good next stop.

Comments