Paste any JSON and get ready-to-use C# types in one click. Nested objects, arrays, optional fields and awkward key names are handled for you, and everything runs in your browser, so API responses and sample payloads are never uploaded.
Root.JSON input
{
"id": 1,
"name": "Alice",
"active": true,
"score": 98.5,
"tags": ["admin"],
"address": { "city": "New York" }
}C# output
using System.Collections.Generic;
using System.Text.Json.Serialization;
public class Root
{
[JsonPropertyName("id")]
public long Id { get; set; }
[JsonPropertyName("name")]
public string Name { get; set; }
[JsonPropertyName("active")]
public bool Active { get; set; }
[JsonPropertyName("score")]
public double Score { get; set; }
[JsonPropertyName("tags")]
public List<string> Tags { get; set; }
[JsonPropertyName("address")]
public Address Address { get; set; }
}
public class Address
{
[JsonPropertyName("city")]
public string City { get; set; }
}| JSON | C# |
|---|---|
| string | string |
| whole number | long |
| decimal number | double |
| boolean | bool |
| array | List<T> |
| object | a class |
| null / unknown | object |
Properties are PascalCase with { get; set; }, and each has a [JsonPropertyName("key")] attribute (System.Text.Json) so the original key is preserved.
var root = JsonSerializer.Deserialize<Root>(json);Describe the same data with the JSON Schema generator, get TypeScript interfaces, create a SQL table, fix broken input with JSON Repair, or compare payloads with JSON Diff.
Paste your JSON and copy the classes. Each object becomes a public class with { get; set; } properties in PascalCase, arrays become List<T>, whole numbers become long and decimals become double.
Yes. Each property has a [JsonPropertyName("key")] attribute so the original JSON key is preserved when deserializing with JsonSerializer.Deserialize<Root>(json). If you use Newtonsoft.Json, swap the attribute for [JsonProperty].
Fields that are null or missing in some array items are generated as nullable types (long?, string?, object?). Everything runs in your browser — your JSON is never uploaded to a server.