1Input JSON
2C# Class Code
Online JSON to C# Class Code Generator
Paste JSON data on the left to automatically generate C# Class files with get; set; property accessors. Supports nested objects and generic lists List<T>. Directly compatible with Newtonsoft.Json (Json.NET) and System.Text.Json. All processing is done locally in your browser, and no data is uploaded to servers.
Features
- Automatically generates
public Type Name { get; set; }properties - Recursively generates corresponding C# subclasses for nested objects
- Maps JSON arrays to
List<T>generics - Customizable root class name (e.g., ApiResponse, DataModel)
- Supports outputting multiple classes simultaneously without duplicate names
Applicable Scenarios
- ASP.NET Core Dev: Quickly generate DTOs for Web API JSON responses
- 3rd-Party API Integration: Convert example JSON from API docs to C# models
- Unity Game Dev: Convert localized configuration JSON to data structures
- .NET Desktop Apps: Map configuration file JSON to strongly typed objects
Frequently Asked Questions
Yes. It uses standard property formats (
public Type Name { get; set; }). If you need [JsonProperty] or [JsonPropertyName] attributes, you can manually add them after generation.Mapped to C#
List<T> generics. Primitive arrays become List<string>, List<int>, List<bool>, etc.; object arrays generate a subclass mapped as List<SubClass>.Completely safe. All parsing and code generation happen locally in your browser. Data is never uploaded to any server, and it works offline.