JSON to C# Class Generator

Paste a JSON sample on the left, get C# classes on the right — with correct types (string, long, double, bool, List, Dictionary) and JsonPropertyName attributes so they deserialize cleanly with System.Text.Json.

100% Client-Side Instant No uploadYour data never leaves your browser

How to use this tool

Paste a representative JSON sample into the input on the left.

C# classes appear on the right after the quicktype engine loads (first run only — subsequent runs are instant).

Copy the output into a .cs file. The root class is named Root by default; rename it to match your domain.

Generated classes include [JsonPropertyName] attributes for System.Text.Json. Nested objects become nested classes; arrays become List<T>.

Everything runs in your browser — safe to use with internal API responses.

Frequently asked questions

Which serializer do the generated classes target?

The output uses [JsonPropertyName] attributes for System.Text.Json, the default in modern .NET. For Newtonsoft.Json, swap the attributes for [JsonProperty] — property names already match.

How are numbers typed?

Integers map to long and decimals to double. quicktype infers the narrowest type that fits every observed value.

How are nulls handled?

Fields that appear as null become nullable reference types (string?, List<T>?) instead of non-nullable ones.

Can I generate other languages?

Yes — TypeScript, Go, Java, Python, and Rust generators are also available, each with its own tool page.

Is this private?

Completely. quicktype runs in your browser; no JSON is uploaded to any server.

Related tools