Convert JSON to C# classes with System.Text.Json or Newtonsoft serialization.
Free online JSON to C# class generator. Paste any JSON object and get C# class or record definitions with [JsonPropertyName] or [JsonProperty] attributes, nullable reference types, PascalCase property names, List<T> for arrays, and DateTime for date strings. Supports both System.Text.Json and Newtonsoft.Json. Perfect for .NET developers building API models. Runs entirely in your browser.
Keywords: json to c#, json to csharp, json to c# class, csharp class generator, json to dotnet, c# model from json, system.text.json, newtonsoft json class, c# serialization, json deserialize c# class, dotnet json class generator, json to record c#
Tags: json, csharp, dotnet, class, model, converter, generator
Paste valid JSON into the input area on the left.
Set the root class name (defaults to 'Root') using the option field.
Choose the serializer: System.Text.Json or Newtonsoft.Json (Json.NET).
Toggle record types (C# 9+) and nullable reference types to match your project settings.
Click Convert or press ⌘↵ (Mac) / Ctrl+Enter (Windows) to generate C# classes.
Copy the generated C# code or download it as a .cs file.
Generates C# classes or records from any JSON object or array.
Supports nested objects — creates separate named classes for each nested structure.
System.Text.Json mode: uses [JsonPropertyName] attributes.
Newtonsoft.Json mode: uses [JsonProperty] attributes.
Optional record types (record class) for immutable C# 9+ data models.
Optional nullable reference type annotations (string?, int?, etc.).
Smart type inference: string, int, double, bool, List<T>, and nullable variants.
Works entirely in your browser — JSON never leaves your device.
Keyboard shortcut ⌘↵ for instant conversion.