JSON to C# Class Generator
Generate C# classes from JSON data instantly. Handles nested objects, arrays, nullable types, and JsonProperty attributes.
Your data is processed entirely in your browser. Nothing is uploaded to any server.
0
Classes
0
Properties
0
Nested Classes
0
Lines
Related Tools
Smart Type Inference
Automatically maps JSON types to C# types: string, int, long, double, bool, DateTime, and nested object classes. Handles null values with nullable types.
JSON Library Support
Generate attributes for Newtonsoft.Json ([JsonProperty]) or System.Text.Json ([JsonPropertyName]).
Configurable Output
Choose collection types (List, IList, array), toggle nullable types, public/private access, auto-properties, and namespace wrapping.
Need a custom tool or web app?
I build MVPs and custom web applications in 7 days. From idea to production, fast, reliable, and scalable. 9+ years of full-stack experience.
ContactFrequently Asked Questions
How do I convert JSON to C# classes?
Paste your JSON data into the input field and the tool instantly generates C# classes with properly typed properties. Nested objects become separate classes, and arrays are typed as List<T> or T[] depending on your settings.
Does it generate JsonProperty attributes?
Yes! You can optionally add [JsonProperty] attributes from Newtonsoft.Json or [JsonPropertyName] from System.Text.Json to map JSON property names to PascalCase C# properties.
How are nested JSON objects handled?
Each nested JSON object is extracted into its own C# class with a PascalCase name derived from the property key. This keeps your code clean and follows C# naming conventions.
Does it support nullable types?
Yes! When enabled, properties that can be null in the JSON are generated with nullable reference types (string?) following C# 8.0+ conventions. Value types with null values become nullable (int?, double?).
Can I choose between List and array for collections?
Yes! You can choose between List<T>, IList<T>, IEnumerable<T>, ICollection<T>, or T[] for collection types. The default is List<T> which is the most commonly used in C# applications.