Paste the JSON and get C# Classes

Download

How to generate JSON to C# classes using our online free tool

Step 1: Paste your JSON into the left side editor

Please copy your JSON string and paste it into the input left editor and please make sure your JSON string is properly structured using curly braces ({ }) and avoid any syntax-breaking characters so that it can convert successfully

Example JSON:

{
  "name": "Alice",
  "age": 25,
  "isEmployed": true,
  "salary": 60000.50,
  "occupation": null
}
            

Step 2: Generate the C# Classes

By Clicking on the Convert button and your C# class will be generated instantly in the right side editor.

Step 3: Copy C# classes and use in your desired project

  • Use the Root class as your base model class.
  • Deserialize JSON using a library like Newtonsoft.Json. or any other of your choice

Our tool will provide a ready-to-use class model tailored to your JSON structure like the below example class

public class Root
{
    public string name { get; set; }
    public int age { get; set; }
    public bool isEmployed { get; set; }
    public double salary { get; set; }
    public object occupation { get; set; }
}
            

How to deserialization example JSON string:

Root myDeserializedClass = JsonConvert.DeserializeObject<Root>(myJsonResponse);