Convert JSON to C#

Form for JSON converting to csharp

This form allows you convert JSON to C# Class, paste or upload your JSON file below:


Your result can be seen below.

Result of JSON conversion to C# Class


Move to "Paste Code" for Save it

About JSON conversion to Csharp Class

About JSON conversion to C# Class

The JSON to C# Converter was created for online transform JSON object into C# class. The attributes in json object are converted into methods in C# class and of course it's totally free converter. You do not need to download any tools for conversion.

How it Works?

Just paste your JSON object to the textarea above and click to the button "Convert" and you will get C# code.

Example of JSON conversion to C#

Before:
{
    "animals":{
	    "dog":[
		    {"name":"Rufus","breed":"labrador","count":1,"twoFeet":false},
		    {"name":"Marty","breed":"whippet","count":1,"twoFeet":false}
	    ],
	    "cat":{"name":"Matilda"}
    }
}
After:
public class DogItem
{
        public string name { get; set; }
        public string breed { get; set; }
        public int count { get; set; }
        public string twoFeet { get; set; }
}

public class Cat
{
        public string name { get; set; }
}

public class Animals
{
        public List <DogItem> dog { get; set; }
        public Cat cat { get; set; }
}

public class Root
{
        public Animals animals { get; set; }
}
After the conversion, you can apply the C# code to your project or use it for some other purpose.