Skip to content
| Marketplace
Sign in
Visual Studio>Tools>JSON to C#
JSON to C#

JSON to C#

Khuong Nguyen

|
27,835 installs
| (7) | Free
Generate c# classes from json
Download

Generate c# classes from json tool for Visual Studio

How to use: Tools menu->JSON to C# -> Paste your Json data -> Generate. Or Copy your json data, right-click on project folder and choose Generate classes from JSON...

Example

JSON

{  
  "requestId": "9db9db74-de37-4d9a-a6b6-c1b2ec2bdfb0",  
  "metadata": {  
    "height": 533,  
    "width": 800,  
    "format": "Jpeg"  
  },  
  "result": {  
    "celebrities": [  
      {  
        "name": "Satya Nadella",  
        "faceRectangle": {  
          "width": 134,  
          "height": 134,  
          "left": 401,  
          "top": 103  
        },  
        "confidence": 0.9576959  
      }  
    ]  
  }  
}

Using Tool Window

Screenshot1.png

Or Copy json and generate c# files direct from your clipboard

Screenshot2.png

C# Results

Screenshot_3.png

public class RootObject  
{  
          [JsonProperty("requestId")]  
          public string RequestId { get; set; }  
          [JsonProperty("metadata")]  
          public Metadata Metadata { get; set; }  
          [JsonProperty("result")]  
          public Result Result { get; set; }  
}  
public class Metadata  
{  
          [JsonProperty("height")]  
          public int Height { get; set; }  
          [JsonProperty("width")]  
          public int Width { get; set; }  
          [JsonProperty("format")]  
          public string Format { get; set; }  
}  
public class Result  
{  
          [JsonProperty("celebrities")]  
          public List Celebrities { get; set; }  
}  
public class Celebrity  
{  
          [JsonProperty("name")]  
          public string Name { get; set; }  
          [JsonProperty("faceRectangle")]  
          public FaceRectangle FaceRectangle { get; set; }  
          [JsonProperty("confidence")]  
          public double Confidence { get; set; }  
}  
public class FaceRectangle  
{  
          [JsonProperty("width")]  
          public int Width { get; set; }  
          [JsonProperty("height")]  
          public int Height { get; set; }  
          [JsonProperty("left")]  
          public int Left { get; set; }  
          [JsonProperty("top")]  
          public int Top { get; set; }  
}  

  • Contact us
  • Jobs
  • Privacy
  • Manage cookies
  • Terms of use
  • Trademarks
© 2025 Microsoft