JSON to C#
Convert JSON to C# classes with JsonPropertyName attributes. Nested objects become classes and numbers map to int or double. Runs entirely in your browser.
JSON input
Generated C#
What this tool does
This JSON to C# converter takes a JSON document and generates C# type definitions from its shape. It runs entirely in your browser — your data never leaves the page.
How it works
1. Infer types. Every value is inspected: strings, numbers, booleans, null, arrays and nested objects.
2. Merge shapes. Array items are merged so optional fields stay optional.
3. Name fields. Keys become valid target-language identifiers.
4. Emit code. C# definitions preserve original JSON keys.