JSON → C# Classes
Generate C# model classes from JSON with PascalCase properties, nullable support, and System.Text.Json attributes.
JSON Input
Generated C# Code
Paste JSON to generate C# classes
JSON to C# Class Generator
Paste any JSON object and get C# classes with PascalCase property names, JsonPropertyName attributes for System.Text.Json, optional nullable types, and namespace wrapping. Nested objects become separate named classes automatically.
Frequently Asked Questions
- What C# serialization attributes are added?
- The generator adds [JsonPropertyName("key")] from System.Text.Json.Serialization — the standard attribute for .NET 5+ JSON serialization. This maps JSON camelCase keys to C# PascalCase properties.
- Does it handle nested objects?
- Yes. Nested JSON objects generate separate named C# classes within the same namespace. The parent class references child classes by name.
- What does the nullable option do?
- With nullable types enabled, string, object, and value types are generated with the ? nullable annotation, suitable for C# 8+ nullable reference types projects.
- Is my JSON sent to a server?
- No. All code generation runs in JavaScript within your browser. Your JSON never leaves your device.