JSON to C#

Generate C# model classes (POCOs) with PascalCase properties from JSON.

JSON Input
C# Output

C# classes will appear here

Ready
Paste JSON and generate C#
0
Classes
0
Properties
Free Code Generator

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

  1. Paste your JSON into the input panel.
  2. Set the root class name and optional namespace.
  3. Enable nullable types or [JsonPropertyName] as needed.
  4. Click Generate C#.
  5. Copy or download the .cs file.

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 .cs file.

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.