JSON to C#
Generate typed C# classes with PascalCase properties from a sample JSON document.
Generate C# classes
Result: —
How to use the JSON to C#
- Paste a JSON sample into the input box.
- Set the root class name you want in your project.
- Click Generate classes and copy the C# code.
Features
- PascalCase properties with get and set accessors
- One class per object shape, named from the key path
- Arrays become generic List types
- Objects that share a shape are merged into one class
Advertisement
Frequently Asked Questions
Common questions about the free online json to c#.
Paste a JSON sample, set the root class name and click Generate classes. The tool infers one
class per object shape with typed properties.
Keys are converted to PascalCase, so a key such as first name becomes the property FirstName
with a public get and set accessor.
An array of objects becomes a List of the matching class and an array of strings becomes a
List of string, with the generic namespace imported.
Every nested object becomes its own class named after the key path, so an address inside a
user object produces a class called UserAddress.
A field that can be null becomes a nullable value type such as int with a question mark,
while text and object fields stay reference types.
No. The output is a plain set of classes, and you can wrap it in your own namespace before
compiling it in your project.
No. Generation runs entirely in your browser, so your sample document never leaves your
device.
Text that is not valid JSON, or a sample that is not an object or an array, produces a clear
error message instead of code.
Last updated: October 10, 2026