C# Class Generator

JSON to C# Class Generator

Convert JSON into clean C# classes for APIs, DTOs and application models.

Converter Workspace

Paste JSON on the left and generate clean C# models on the right.

JSON Input

JSON

C# Output

Ready
Serialization Attributes Generate System.Text.Json JsonPropertyName or Newtonsoft.Json JsonProperty attributes.
Nested Classes Nested objects and arrays of objects are converted into separate C# classes.
Type Inference Detects string, bool, numeric types, DateTime, Guid, arrays and nullable values.

JSON to C# Class

This page is designed for developers who need an online JSON to C# class tool with clean C# output, nullable reference types, nested classes and JSON serialization attributes.

  • Generate C# classes from JSON.
  • Support nested objects and arrays.
  • Optionally add JSON serialization attributes.
FAQ

Frequently asked questions

Can JSON arrays be converted to List<T>?

Yes. Arrays can be generated as List<T> or C# array types depending on your settings.