JSON to C# Class
Paste JSON and generate clean, ready-to-paste C# classes with nested models, namespace output, and JSON serializer attributes.
Input JSON
Generated C#
Your generated C# classes will appear here.How to use this tool
- Paste a JSON object or array into the input box.
- Set the root class name, namespace, and serializer attribute options.
- Enable nullable references, DateTime detection, or list initialization if needed.
- Copy the generated C# classes into your project.
Mixed-type arrays and inconsistent sample shapes fall back to
object when a safe, more specific C# type cannot be inferred.What it handles
- ✅ Nested classes
- ✅ Root arrays and
List<T>output - ✅ Nullable properties
- ✅
DateTimedetection - ✅ JSON serializer attributes
FAQ
Does this tool send my JSON to a server?
No. Everything runs in your browser, so your JSON stays on your device.
Does it support root JSON arrays?
Yes. Root arrays generate a wrapper class that inherits from List<T>.
Can it generate serializer attributes?
Yes. You can add JsonPropertyName, JsonProperty, or both.
What happens to null values?
Nullable or missing fields become nullable value types like int? or nullable reference types like string? when that option is enabled.