JSON to C#
Generate C# model classes (POCOs) with PascalCase properties from JSON.
C# classes will appear here
JSON to C# Model Generator
Paste any JSON object and instantly generate clean C# model classes (POCOs) with auto-capitalized PascalCase property names, nullable reference types, and optional [JsonPropertyName] attributes for System.Text.Json — all running locally in your browser.
How to generate C# from JSON
- Paste your JSON into the input panel.
- Set the root class name and optional namespace.
- Enable nullable types or
[JsonPropertyName]as needed. - Click Generate C#.
- Copy or download the
.csfile.
Features
- PascalCase auto-conversion for property names.
- Type mapping: string, int, double, bool, object, List<T>.
- Nested objects as separate class definitions.
- Optional
[JsonPropertyName]for System.Text.Json. - Optional nullable reference types (
string?). - Download as
.csfile.
Frequently Asked Questions
What C# types are used for JSON values?
JSON string → string, JSON integer → int, JSON decimal → double, JSON boolean → bool, JSON null → object?, JSON array → List<T>, JSON object → a new C# class.
What is [JsonPropertyName]?
[JsonPropertyName("camelCase")] is an attribute from System.Text.Json.Serialization that maps a JSON key to a C# property with a different name — useful when your JSON uses camelCase but your C# uses PascalCase.
Is my JSON sent to a server?
No. All generation runs entirely in your browser. Your JSON never leaves your device.