JSON to C#
Generate C# classes from JSON data.
Runs entirely in your browser.
Convert JSON to C# Tool
About JSON
JSON (JavaScript Object Notation) is a lightweight data-interchange format. It is easy for humans to read and write. It is easy for machines to parse and generate.
Learn more: JSON Tutorial
About C# Classes for JSON
In C#, JSON is typically deserialized into classes with auto-implemented properties ({ get; set; }) using System.Text.Json or Newtonsoft.Json. Property names in C# are written in PascalCase by convention, while JSON keys are often lowercase or snake_case.
This tool generates PascalCase properties and adds a [JsonPropertyName("...")] attribute (from System.Text.Json.Serialization) whenever the JSON key differs from the property name, so deserialization maps fields correctly. Types are inferred from your sample: strings become string, whole numbers int, decimals double, booleans bool, arrays List<X>, and nested objects become their own class. Mixed or unknown types fall back to object.
Learn more: C# Tutorial