How to use the json to c#
- Paste your source into the input panel, or select Load sample.
- Set a root model name for the generated code.
- Select Run tool, review the result, then copy or download it.
Working with C# models
Use the generated classes with System.Text.Json. Property mappings preserve snake_case API keys. Review inferred numeric ranges, required fields, and nullability before using the models in production.
Example input
{
"user_id": 42,
"name": "Alex",
"active": true,
"address": {
"city": "Dubai"
},
"roles": [
"developer",
"reviewer"
]
}Frequently asked questions
Which JSON library do the classes use?
The generator uses System.Text.Json.Serialization.JsonPropertyName attributes, preserving original JSON keys while using PascalCase property names. Nullable reference types are enabled.
Does it handle nested objects and arrays?
Yes. Nested objects become separate classes and arrays become List<T>. Integers are inferred as long, decimal numbers as double, and mixed or empty arrays use object. Review the result against your complete API contract.
A note about your data
Input and output remain in this browser tab. CompileTime does not upload them for processing or save them in local storage. Avoid pasting production credentials into any online tool. Optional analytics track tool names and actions, never the entered values.