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.Â