Generate classes from JSON


This tool generates C# model or stub classes from JSON document. You can select the property naming convention and whether or not to annotate the properties.



Input: Paste JSON content below



Settings



Output: Generated Classes


JSON pronounced as "Jason" is the de facto standard for data interchange on the web these days. It is a simple format that is easier to comprehend than XML. It also has less size than XML because of no closing tags. Interacting with JSON from JavaScript is extremely seamless.
Language
The language for which you want the classes to be generated. Currently C# is the only option available. But, we intend to extend it to Java in the near future.
Annotate
If selected, properties are annotated using Newtonsoft.Json's JsonProperty attribute.
Annotate On
public class Person
{
    [JsonProperty("fullName")]
    public string fullName { get; set; }

    [JsonProperty("age")]
    public int age { get; set; }
}
Annotate Off
public class Person
{
    public string fullName { get; set; }
    public int age { get; set; }
}
Property Naming Strategy
Choose the naming strategy of the generated properties. The available options are:-
Cleanse Only
public class Person
{
    [JsonProperty("Full Name")]
    public string FullName { get; set; }

    [JsonProperty("age")]
    public int age { get; set; }
}
Pascal Case
public class Person
{
    [JsonProperty("Full Name")]
    public string FullName { get; set; }

    [JsonProperty("age")]
    public int Age { get; set; }
Camel Case
public class Person
{
    [JsonProperty("Full Name")]
    public string fullName { get; set; }

    [JsonProperty("age")]
    public int age { get; set; }
}