Hardware FixRecommendedDevice not working? Your driver may be the problemCheck updates for common hardware issues.Fix DriversOctober DealsAmazon USOctober deal check: compare before you payAmazon US: current deals, useful picks and tech finds.Check DealsClean PCRecommendedOne scan can reveal what keeps slowing WindowsLook for cleanup and repair opportunities.Run Scan×
Skip to content
World desk8 min

Why JSONC Accepts Comments and Trailing Commas When JSON Does Not

JSONC extends JSON for human-edited configuration. Comments are part of its draft syntax, while trailing commas remain optional and parser-dependent—so a file accepted by an editor can still fail in a strict JSON consumer.
Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

JSONC accepts comments because it is an extension of JSON for human-edited files, not the JSON interchange format defined by RFC 8259. Its comment syntax adds JavaScript-style // and /* … */ annotations. Trailing commas are a separate, optional extension: some JSONC parsers allow them, while others reject them unless an option is enabled.

That distinction explains why a file such as settings.json can contain comments in an editor but fail in a strict JSON parser. The editor is applying a JSONC-like dialect; the receiving program may require standards-conforming JSON.

As an Amazon Associate I earn from qualifying purchases.

JSON and JSONC are different language contracts

JSON is a standardized data-interchange format. JSONC is a family of JSON-based syntaxes used primarily for configuration files that people read and edit. JSONC keeps JSON’s objects, arrays, strings, numbers, booleans and null, then adds conveniences that are outside the strict JSON grammar.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Feature RFC 8259 JSON JSONC implementations
Single-line comments Not part of the grammar Usually accepts // comments
Block comments Not part of the grammar Usually accepts /* ... */ comments
Trailing commas Not allowed Optional and parser-dependent
Primary use Interchange between independent systems Human-maintained configuration
Interoperability Expected by strict JSON consumers Requires agreement on the dialect and parser options

The word “JSONC” therefore does not guarantee one universal behavior. The JSONC.org specification is a draft, and the Common JSONC Specification repository was still marked as a draft on September 1, 2025. Some tools use the label for comments only; others also permit trailing commas or add further syntax.

#1 Best Overall
Sale
TOZO A1 Wireless Earbuds Bluetooth 5.3 Light Weight in Ear Headphones
  • [Ultra-Lightweight Ear Buds Designed for Small Ears] Each earbud weighs only 3.7g and features a compact, ergonomic in-ear design made especially for small ears. Secure, low-profile, and comfortable for workouts, all-day wear or overnight sleeping.The ultra-slim profile sits flush in your ear with no hard edges poking or rubbing, so you can even sleep on your side without discomfort.
  • [Immersive Stereo Sound with TOZO OrigX Technology] TOZO OrigX tuning delivers clear vocals, balanced mids, and natural stereo sound for music, podcasts, and videos.
  • [Long Battery Life for Daily Use] Get up to 7 hours of playtime on a single charge, with up to 32 hours total using the charging case—ideal for workdays, commuting, and extended listening sessions.
  • [Bluetooth 5.3 & Stable Connection] Bluetooth 5.3 provides fast pairing, stable wireless performance, and reduced dropouts as you move around home or office.
  • [Deep Bass with Clear Vocals] High-performance drivers produce punchy bass while keeping vocals clean and detailed for everyday listening.

What RFC 8259 actually permits

RFC 8259 describes JSON as “a lightweight, text-based, language-independent data interchange format.” Its stated goals include being minimal, portable and textual. The grammar represents arrays and objects as comma-separated sequences. A comma separates two values or two members; there is no grammar production for a comma after the final value or member.

Why a trailing comma is invalid JSON

This array is valid JSON because the comma appears only between elements:

["red", "green", "blue"]

This one is not valid RFC 8259 JSON:

["red", "green", "blue",]

The final comma tells a strict parser that another element should follow. Because the grammar ends the sequence after "blue", the parser encounters an unexpected token and reports a syntax error.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Why comments are invalid JSON

JSON permits insignificant whitespace between tokens, but it has no comment token. Inserting // explain this value or /* explain this value */ introduces characters that RFC 8259 does not define as part of a JSON value.

{
  "timeout": 30 // seconds
}

A strict parser must reject that document. The fact that JavaScript, a text editor or a particular configuration loader accepts it does not change its status under RFC 8259.

The RFC does not assign a single historical motive for omitting comments. What it establishes is a deliberately narrow interchange grammar and the boundary of that grammar. Claims that comments were excluded for one definitive reason go beyond what the standard itself says.

Rank #2
Sale
Smart Watch for Men Women Compatible with iPhone Samsung Android Phone 1.69 inch Full Touch Screen IP68 Waterproof Bluetooh Fitness Tracker Heart Rate/Sleep Monitor (Black)
  • 【IP68 Waterproof Multifunctinal Smart Watch】Torjalph fitness activity tracker smart watch is IP68 waterproof technology ,you can wear it when swimming,handwashing,it's rain-proof which means that you perform multiple exercise modes outside without worrying about sweat or rain corroding your fitness smart watch,and this watch equipped with a 230 mAh large capacity battery magnetic charging ,and this sports activity tracker watch can be used 5-7 days If fully charged.
  • 【Larger 1.83'' Full Screen Watch & Multi-dial Selection】1.83 inch full HD color touch screen smart watch for men / women provides excellent 240*284 resolution image quality ,This Bluetooth smart watch offers a better touch experience and remarkable immersion and ,more than 200 watch faces for you to choose from App"Da Fit ", you can change the dial style according to your mood to wear keeping the world on your wrist
  • 【Accurate Activity Tracker Smart Watch 】sports watch activity tracker uses sweat and dust resistant breathable silicone strap, our Fitness Tracker Smart Watch for Android iOS Phones supports 12 sports modes,walking,running,bicycle,swimming,badminton,basketball,football,rope skipping. This bluetooth calls smart watch for men women is lightweight and stylish, bringing more convenient and relaxing sports experience while also providing more protection.
  • 【Your 24 Hour Personal Daily Health Monitor】Fitness watch for women men full touch screen IP67 waterproof bluetooth smartwatch for Android iOS Phones with heart rate blood pressure monitor multifunction Andriod smart watch with steps counter sleep monitor sports fitness watch, monitoring blood oxygen saturation allows you to understand your physical condition in real time to track fitness progress ,to know your health status in time.
  • 【More Functions Bluetooth Call Smart Watch】This fitness activity smart watch full screen for iPhone and Android phones includes a bunch of new features including:The bluetooth smart watch can hang up the phone, receive and display WhatsAPP /Text /Facebook /Twitter /Messenger reminder.Support sedentary reminder, alarm clock, stopwatch, timer,weather information,music control, remote camera control compatible with Android 5.0 and above or iOS 9.0 and above smartphones.

What JSONC adds

JavaScript-style comments

The draft at JSONC.org defines JSONC as JSON plus two comment forms:

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
  • Line comments: // continues to the end of the line.
  • Block comments: /* continues until the next */.

Comments may appear anywhere insignificant whitespace is allowed. A block comment cannot nest inside another block comment. A conforming JSONC parser ignores comments when it constructs the data representation. The specification states: “Comments provide context alongside the data, but they MUST NOT affect consumption.” In other words, a comment can document a value, but it must not create a property, array element or other piece of data.

{
  // Network connection limit
  "maxConnections": 20,
  "retry": /* temporary failures */ true
}

The represented data is equivalent to the following comment-free object:

{
  "maxConnections": 20,
  "retry": true
}

Whether a tool preserves the original comments and spacing for later editing is an implementation question. A parser that returns ordinary data can discard that authoring information, so check the chosen library if round-tripping comments matters.

Trailing commas are optional

Comments and trailing commas should not be treated as one inseparable feature. The JSONC.org draft says parsers may support trailing commas; it does not require them. Its reference implementation, jsonc-parser, sets allowTrailingComma to false by default. A document ending an array or object with a comma is therefore an error unless the caller enables that option.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Some editor modes accept trailing commas. The draft notes that Visual Studio Code’s JSON-with-comments mode accepts them, while warning about them outside certain official configuration files. These details can change with editor and parser releases, so verify the current setting rather than inferring behavior from the file extension.

Rank #3
New Bee Guitar Cable 10ft Electric Instrument Bass AMP Cord
  • [Low Noise High Fidelity] New bee guitar cord with 22AWG oxygen-free-copper center conductors provides enhanced signal transfer, the PVC insulation material and the high-density stranded copper double shield provide noise rejection for quiet operation
  • [Ideal for Choice] New bee 1/4 straight and right angle metal connectors, ensures a secure connection in any instrument, pedal, or amp jack. L shape great fro on stage guitar stands
  • [Wide Compatible] Suitable for mixer, power amplifier, microphone, effector, decoder, equalizer, electoronic organ, electric guitar, electric bass and other electronic equipments. Widely used in the installation of smart home, karaoke speaker, professional stage audio, etc
  • [Easy Disassemble] Making incidental repairs quick and easy! Very nice, flexible cable
  • [Dont Hesite to Order] 24 hours customer services and professional technology team are standing by
{
  "formats": [
    "json",
    "jsonc",
  ],
}

This is JSONC only when the active dialect allows trailing commas. A comments-only JSONC parser can still reject it even though it accepts the comments.

Why configuration files use JSONC

Comments keep explanations next to settings

Configuration values often need context that should not become application data: units, safe ranges, migration notes, links to internal documentation or a warning about a setting. JSON has no comment construct, so authors who need strict JSON sometimes add artificial properties such as "_note". That changes the data model and may collide with a real property name. JSONC lets the explanation remain metadata for the human reader.

Trailing commas simplify manual edits

When trailing commas are supported, adding a new final item can be a smaller edit because the previous line already ends with a comma. Reordering or temporarily removing an item also requires less punctuation adjustment. This is a practical editing benefit, not a standards requirement or a measured performance claim.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Human-friendly input can still produce machine-friendly output

A build or deployment process can read JSONC, remove comments and permitted trailing commas, then serialize strict JSON for a service that speaks RFC 8259. The two stages serve different audiences: JSONC for maintainers and JSON for interchange.

Why a file named settings.json may allow comments

File extensions are conventions, not proof of the grammar accepted by a program. An editor may associate settings.json with a JSON-with-comments language mode for compatibility with its configuration ecosystem. The same text sent to an API, another programming language’s standard-library parser or a validator may be processed as strict JSON and fail.

The safest interpretation is: identify the component that reads the file, then consult that component’s documented dialect. Do not assume that every file ending in .json is interchangeable with every other JSON reader.

Rank #4
BSIMB 15.6" Digital Family Calendar & Chore Chart, No Subscription Fees
  • Digital Family Calendar: BSIMB digital calendar wall touch screen puts an end to your chaotic life. Designed for busy families, the digital calendar keeps you organised and in step with your family. Assign different colours and tasks to each family member to make family scheduling easier and more intuitive.
  • Easy Setup and Auto-Sync: Plug in, connect to WLAN and auto-syn your electric calendar in minutes. Digital wall calendar compatible with Google calendar, iCloud calendar, Outlook calendar, Cozi calendar and Yahoo calendar. Add events directly on the device or through the ecalendar app. Electronic calendar stays current whether you're at work or traveling—no manual updates needed.
  • All-In-One Home Assistant: Smart calendar builds habits and encourage independence with personalised chores. Display daily meal plan to reduce the daily ‘What's for dinner?’ stress. To-do lists keep track of everything you want. Turning chores into valuable achievements with stars and rewards, making life easier and more enjoyable.
  • Manage Anytime Anywhere: BSIMB electronic calendar for family stay connected with the powerful ecalendar app. Access and manage your digital wall calendar anytime, anywhere with free features like stars & rewards, photo screensaver, chore charts, meals plans, to-do lists etc. Electronic planner paid features like Magic Import tailor advanced tools for users with special needs.
  • Stay in Touch with Loved Ones: Share photos or videos from your phone to electronic wall calendar with app, instantly update your life moment, and keep in touch with your family, especially those who are far away; you can also surprise your smart calendar digital wall by sending him a wish card; it's also great for keeping tech-illiterate elders in touch with the youngsters.

Parser behavior to check before choosing JSONC

Implementations differ in more than the spelling of the format. Compare these behaviors for the exact parser and version used in your project:

What’s actually slowing this PC down?

Pick the symptom - the matching free tool is one click away.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.
Question Why it matters
Are // comments accepted? Line annotations may be rejected by a comments-only or strict parser.
Are /* ... */ comments accepted? Some tools support one comment form but not the other; block comments do not nest.
Are trailing commas accepted by default? Support may require an option such as allowTrailingComma.
Are comments and formatting preserved? A plain data parse may lose authoring information needed for an editor or formatter.
Does the output serialize as RFC 8259 JSON? Strict downstream consumers need comments and trailing commas removed.
What file extensions and media types are advertised? Tooling, validators and HTTP clients may select a parser from those labels.

The Deno documentation demonstrates parsing JSONC with a standard-library parser and presents the format as JSON extended with comments and trailing commas for friendlier configuration editing: Deno’s JSONC parsing example. That example illustrates one ecosystem; it is not evidence that every JSONC parser uses identical defaults.

Independent reader supportYour contribution helps us test, update, and keep practical guides available for everyone.Support on Ko-Fi

How to use JSONC without breaking a strict consumer

1. Identify the boundary

Write down where the file is edited, where it is parsed and where the resulting data is transmitted. A local editor, a build script and a remote API may each enforce different grammars.

2. Select the dialect explicitly

Confirm whether the parser supports line comments, block comments and trailing commas. If trailing commas are optional, decide whether to enable them rather than relying on an undocumented default. Pin or review the parser version when configuration files are shared across machines.

3. Use an unambiguous name and type

The JSONC draft recommends the .jsonc extension and the application/jsonc media type. It warns against labeling JSONC as application/json, because a strict consumer can reject or misinterpret it. Follow those recommendations when you control the file or HTTP metadata.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

4. Validate with the same settings used in production

A formatter or editor preview is not a substitute for the production parser. Test a file containing each syntax feature you intend to permit, including a line comment, a block comment and a final comma. Then test malformed variants to ensure failures are reported before deployment.

5. Convert at the interchange boundary

When a downstream system requires JSON, parse the JSONC with the agreed options and serialize the resulting data as ordinary JSON. The serialized output must contain no comments and no trailing commas. Do not merely rename the file or change its media type; those actions do not change the bytes.

Common failures and their fixes

“Unexpected token /” or “comments are not allowed”

The reader is operating in strict JSON mode. Remove the comments, use a JSONC-aware parser, or add a preprocessing step that converts JSONC to strict JSON. Do not add comment text as fake application properties unless those properties are intentionally part of the schema.

“Trailing comma” errors even though comments work

The parser supports comments but has trailing-comma support disabled. Enable the documented option if the file is controlled and the dialect permits it, or remove the final commas. The JSONC.org reference parser’s default is to reject them.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

The editor accepts a file but a service rejects it

The editor is likely using a JSONC-like language mode while the service expects RFC 8259 JSON. Add an explicit conversion and validation step before upload, and send the service the serialized JSON with the correct application/json media type.

Different tools disagree about the same file

That is possible because “JSONC” is not one universal parser mode. Compare the tools’ comment rules, trailing-comma defaults and supported extensions. The Common JSONC Specification project tracks a commonly implemented dialect, but its document remains a draft and notes that variants differ: some disallow trailing commas, while others add syntax beyond the common form. See the Common JSONC Specification for the current project status and scope.

Choosing between strict JSON and JSONC

  • Choose strict JSON when the text is an interchange payload, public API body, signed artifact or input consumed by unknown third-party implementations.
  • Choose JSONC when people maintain the file and the complete toolchain explicitly supports the dialect.
  • Use a conversion step when maintainers need comments but an external system requires RFC 8259 JSON.
  • Document the parser options when trailing commas are enabled, because another tool may default to rejecting them.
  • Use the recommended extension and media type when you can control them, so readers and software can distinguish JSONC from strict JSON.

The central reason JSONC can accept syntax that JSON cannot is scope: JSONC deliberately extends the JSON data model for human-edited configuration, while RFC 8259 defines a minimal grammar for interoperable data exchange. Comments are a defined JSONC extension; trailing commas are an optional implementation feature. Treating those facts separately prevents the most common portability mistakes.

Product prices and availability are accurate as of the date/time indicated and are subject to change. Any price and availability information displayed on Amazon at the time of purchase will apply.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

Leave a Reply

Your email address will not be published. Required fields are marked *

Free tools Windows power users keep installed

One-click scans. No signup required.

Special offer. See more information about Outbyte and uninstall instructions. Please review EULA and Privacy policy.

More from the Wire

  1. World desk4 min
    How to Spot an AI Voice Scam Before Sending MoneyDon’t rely on how a caller sounds. Pause, call back through a known number, and verify the emergency with another trusted person before sending money.
  2. Mountain View desk4 min
    Google’s SynthID Detector: How to Check AI-Generated Images, Video and AudioGoogle’s SynthID Detector looks for an embedded watermark in supported images, video and audio. Here is what its results do—and do not—show.
  3. Redmond desk20 min
    How to create a link to File or Folder in Windows 11Windows 11 gives you several ways to point to a file or folder without moving or duplicating it. You can create a desktop shortcut,…
Recommended PC Tool
Recommended PC Tool
Outdated Drivers Are Slowing You DownFree scan - exact matches
PC Slower Than It Used to Be?Free scan - under a minute

Two free Windows tools

One Free Minute Could Fix That PC

Before you go - each of these free tools takes about a minute and tackles what quietly slows a Windows PC down.

Special offer. View Outbyte info, uninstall instructions, EULA, and Privacy Policy.