JSON to C# Class Generator

Code Generators

Generate strongly-typed C# classes from JSON instantly. Nested objects, List<T>, DateTime, nullable types, JsonPropertyName attributes and PascalCase options — copy ready-to-use code.

100% Client-Side — Your data never leaves your browser.
Class name
Options
JSON Input
C# Output

Paste an API response (or click "Load Sample") to generate strongly-typed C# classes.

How to Use

Three steps from raw data to finished output — no account required.

  1. 1

    Paste the JSON response you want to model, or load the sample payload.

  2. 2

    Toggle JsonPropertyName attributes and PascalCase property naming to match your project style.

  3. 3

    Copy the generated C# classes — including nested models — straight into your .NET project.

Frequently Asked Questions

Everything you need to know about the json to c# class generator.

It maps JSON to int, long, double, bool, string, DateTime, List<T>, Dictionary<string, object> and nested classes, adds nullable annotations (#nullable enable), honors first-seen property order and emits using directives ready for System.Text.Json.

It adds [JsonPropertyName("...")] above each property to preserve the original JSON key. Enable it when System.Text.Json must deserialize camelCase or snake_case payloads into properties with different C# names.

Enable PascalCase to follow official .NET naming guidelines — camelCase keys such as userId become UserId. Combined with JsonPropertyName, you get idiomatic C# identifiers that still deserialize from the exact original JSON keys.

Yes. The output includes the System.Text.Json.Serialization namespace and JsonPropertyName attributes, so Deserialize<T> works immediately. The same classes also work with Newtonsoft.Json when you add its JsonProperty attribute.