JSON to C# Classes

POCOs with auto-properties, PascalCase names, JsonPropertyName mappings and List<T>.

A .NET project consuming a JSON API starts by turning the response into C# classes: properties want PascalCase (the C# convention) while JSON keys are camelCase, and hand translation is slow and leaks nested fields. This tool expands JSON into a set of POCOs — nested objects become their own classes with get; set; auto-properties, and [JsonPropertyName] bridges the naming gap for System.Text.Json.

Type mapping: int, double, bool, string and List<T> for arrays; null fields carry the ? nullable annotation. Array roots fall back to List<object?> or model from the first element.

Why System.Text.Json rather than Newtonsoft

System.Text.Json ships with .NET Core 3.0+ — no extra dependency, better performance, and the de-facto default for new projects. Legacy Newtonsoft.Json projects just swap [JsonPropertyName] for [JsonProperty]; the mapping keys are identical.

The nullable annotation strategy

Reference-typed fields emit with the conservative object? annotation; value types (int/double/bool) are naturally non-nullable. With <Nullable>enable</Nullable> in your project, drop the ? from fields you know are required to tighten the model.

Frequently asked questions

What runtime does the code need?
.NET Core 3.0+ / .NET 5+ include System.Text.Json; .NET Framework needs the System.Text.Json NuGet package — or the Newtonsoft annotation swap.
Fields or properties?
Auto-properties, the serialization standard for C#. System.Text.Json serializes public properties by default and needs extra configuration for public fields — follow the default and skip the pitfalls.
Are nested collections (List<List<T>>) supported?
Yes — types infer recursively, and nested objects still become their own classes.

Related tools