Nested SupportAuto Properties100% Private
public class Root
{
    public int Id { get; set; }
    public string Name { get; set; }
    public string Email { get; set; }
    public bool Active { get; set; }
    public double Score { get; set; }
    public Address Address { get; set; }
    public List<string> Tags { get; set; }
}

public class Address
{
    public string Street { get; set; }
    public string City { get; set; }
}

FAQ

What C# features are generated?
The tool generates public classes with auto-properties (get; set;). Nested objects create separate class definitions with proper type references.
Are arrays handled?
Yes. JSON arrays are converted to List<T> where T is inferred from the first element of the array.
Can I change the root class name?
Yes. Use the Root class input field to set a custom name for the top-level class.
Share:

About JSON to C#

What this tool does

Data converter tools transform structured data between JSON, CSV, YAML, XML, TOML, SQL, TypeScript interfaces, Go structs, and more. They handle nested objects, arrays, and type inference automatically.

Why use this tool

APIs return JSON, spreadsheets export CSV, infrastructure config uses YAML, and legacy systems speak XML. Being able to convert between these formats without writing a custom script saves hours of tedious data wrangling.

How it works

The tool parses your input format into an in-memory object tree, then serializes that tree into the target format. Type information (string, number, boolean) is inferred from values and mapped to the closest equivalent in the output format.

Pro tip

When converting CSV to JSON, the first row is treated as column headers by default. If your CSV has no headers, toggle that option off to get array-of-arrays output instead.

Love this tool? Explore 12467+ more

Free online tools for images, PDFs, text, code, and more. All running in your browser.

Explore All Tools