Skip to the content.

Tools and Libraries

Several tools and libraries support JSONC, enabling developers to parse and generate JSONC data easily. This is a non-exhaustive list organized by programming language.

Parsers

Language Tool/Library Comments Trailing Commas Notes
C jmtilli/caj 🟡 1 🟡 2  
C++ nlohmann/json 🟡 3 🟡 4  
C++ RapidJSON 🟡 5 🟡 6  
C++ stephenberry/glaze 🟢 7 🔴  
Elixir massivefermion/jsonc 🟢 🟢 Includes additional extensions
Go HuJSON 🟢 🟢  
Go tidwall/jsonc 🟢 🟢  
Java Jackson 🟡 8 🟡 9  
JavaScript microsoft/node-jsonc-parser 🟢 🟡 10  
Kotlin kotlinx.serialization.json 🟡 11 🟡 12  
PHP otar/jsonc 🟢 🟢  
Python n-takumasa/json-with-comments 🟢 🟢  
Rust dprint/jsonc-parser 🟢 🟢  
Swift steelbrain/JSONCKit 🟢 🟢  

Legend:

🟢: Default support
🟡: Optional support
🔴: Unsupported


  1. Use caj_allow_comments(ctx) â†©

  2. Use caj_allow_trailing_comma(ctx) â†©

  3. Use ignore_comments â†©

  4. Use ignore_trailing_commas â†©

  5. Use kParseCommentsFlag â†©

  6. Use kParseTrailingCommasFlag â†©

  7. Use glz::read_jsonc (or using options: glz::opts{.comments = true}). See Documentation↩

  8. Use JsonFactory.enable(JsonReadFeature.ALLOW_JAVA_COMMENTS) â†©

  9. Use JsonFactory.enable(JsonReadFeature.ALLOW_TRAILING_COMMA) â†©

  10. Use allowTrailingComma: true â†©

  11. Use allowComments. See Documentation↩

  12. Use allowTrailingComma. See Documentation↩