Convert JSON to C# Classes Online

Generate C# class from JSON object online. Check out the help panel below to view details on how to use this converter.
{ "you" : "Paste your JSON here" } C# Classes
How to generate C# Classes from JSON ?
JSON stands for JavaScript Object Notation · JSON is a lightweight open standard file format and data interchange format that uses human-readable text to store and transmit data objects consisting of attribute–value pairs and arrays.

JSON to C# conversion will check for format of the JSON, and shows the error message if format not valid. If Json format is valied, then it will identify all the attributes and its types based on its value, and then finds the attributes inside and goes on.
Attribute data types includes int, string, DateTime, Array and List.
Step 1 : Copy and paste the JSON string
Make sure that the JSON string is well formatted. The JSON object should be wrapped with curly braces and should not be escaped by backslashes.

Sample JSON:
{
      employee :
      {
            id : 1001,
            hireDate : "01/12/2015",
            fullName :
            {
                  firstName : "Venkat",
                  lastName : "Cherukuru",
                  middleName : "C"
            },
            country : "India",
            aliasNames : [ "Venkat", "Venki", "Cherukuri" ],
            favouriteNums : [7, 9, 11]
      },
      certifications :
      [
            {
                  name : "AZ-900",
                  desc : "Azure Fundamentals",
                  date : "1/10/2021"
            },
            {
                  name : "DP-100",
                  desc : "Data Science Associate",
                  date : "7/4/2021"
            }
      ]
}
Step 2 : Click on Convert button to generate C# classes.
Click the convert button and wait a few seconds until your C# classes appear.
Step 3 : Copy the generated C# classes.
When you copy the returned classes in the directory of your solution, you can deserialize your JSON response using the 'Root' class using any deserializer like Newtonsoft.

C# Classes for above sample JSON:
public class Root
{
public Employee employee { get; set; }
public List<Certification> certifications { get; set; }
}

public class Employee
{
public int id { get; set; }
public DateTime hireDate { get; set; }
public FullName fullName { get; set; }
public string country { get; set; }
public string[] aliasNames { get; set; }
public int[] favouriteNums { get; set; }
}

public class FullName
{
public string firstName { get; set; }
public string lastName { get; set; }
public string middleName { get; set; }
}

public class Certification
{
public string name { get; set; }
public string desc { get; set; }
public DateTime date { get; set; }
}