JSON to C#

Generate idiomatic C# records or classes from any JSON sample. Built for System.Text.Json and modern .NET. 100% in-browser.

ROOT
STYLE
JSON INPUTsample payload
C# OUTPUT
// C# records appear here

From JSON sample to typed model in one click

The fastest way to consume a JSON API in .NET is to deserialize into typed records. The bottleneck is usually writing the types — copy/paste from documentation, fight with PascalCase conventions, add [JsonPropertyName] for snake_case keys. This tool does that pass for you.

The output is record-by-default, immutable, value-equal — the modern .NET style. Nested objects become nested records with the parent class name derived from the field name. Switch to mutable classes when you need EF Core entities or older framework targets.

System.Text.Json native

Output ready to deserialize with JsonSerializer.Deserialize<Root>(json) — no Newtonsoft dependency, no custom converters needed for the common cases.

Privacy first

Generation runs in this browser tab. You can paste production payloads without exposing them — the bytes never leave your machine.

Common questions

What does this tool generate?
Idiomatic C# record types (or classes) matching the shape of your JSON. Properties are PascalCase, nested objects become nested records, arrays become List<T>. The output works with System.Text.Json out of the box.
Records or classes?
Records by default — they are immutable, value-equal, and concise (modern .NET style since C# 9). Switch to classes via the toggle if you need mutability or you are on an older target framework.
How are nullable types handled?
Fields that appear as null in the JSON are emitted as nullable types (string?, int?). Fields that are missing from some records but present in others are treated the same way — the tool walks every sample to detect optional fields.
What about JSON property names that are not valid C# identifiers?
A [JsonPropertyName("original-name")] attribute is added when the JSON key contains hyphens, dots, or starts with a digit. The C# identifier is normalized to PascalCase.
Does the output use Newtonsoft.Json or System.Text.Json?
System.Text.Json — the modern, built-in serializer that ships with .NET 5+. If you still need Newtonsoft, replace [JsonPropertyName] with [JsonProperty] in the output. The class structure is identical.
Is my data private?
Yes. Generation runs locally in this browser tab. No upload, no logging.