JSON to C# Class
Generate C# classes from JSON with PascalCase properties, System.Text.Json [JsonPropertyName] attributes, List types and nullable values. Free and private.
Runs in your browser. Nothing is uploaded.
About JSON to C# Class
JSON to C# creates classes with auto-properties for every key, renamed to PascalCase, with [JsonPropertyName("...")] attributes so System.Text.Json maps them back to the original JSON names. Arrays become List<T> and nested objects become their own classes.
It's the same job as Visual Studio's Paste JSON as Classes, available anywhere, including on a machine without an IDE.
How to use JSON to C# Class
- Type or paste your text into the input box. Press Sample to see an example.
- Adjust the options. The result updates as you type.
- Copy the result, or press Use as input to chain another transformation.
Frequently asked questions
Does it work with Newtonsoft.Json?
Untick the attributes option and Newtonsoft's default case-insensitive matching will map the properties, or swap the attribute for [JsonProperty].
How are nulls handled?
Values that are null in the sample become nullable types such as long? or object.
Is JSON to C# Class free and private?
Yes. JSON to C# Class is completely free with no sign-up. Everything runs in your browser, so whatever you type or paste never leaves your device.