JSON to C#

Convert JSON to C# classes online. Strongly-typed POCOs with properties, nullable annotations, and JsonProperty attributes generated instantly.

Generated code will appear here...

Everything runs locally in your browser. Your JSON is never uploaded or stored.

What is a JSON to C# converter?

A JSON to C# converter turns a raw JSON sample into ready-to-use C# classes (POCOs). Paste an API response and get strongly-typed models with properties you can drop straight into a .NET project. Everything runs in your browser.

How to generate C# classes from JSON

Paste your JSON and the classes appear live. Press Copy and add them to your solution — the output compiles as-is with no manual fixes for common payloads.

Type mapping

int maps to int, fractional numbers to double, nulls or missing values become nullable types such as int?. Arrays become List<T> and objects with mixed keys become Dictionary<string, T>.

Naming and attributes

Keys are PascalCased for C# conventions. When the original key differs beyond casing, a [JsonProperty] attribute keeps deserialization working, and missing or null fields use nullable annotations.

Frequently Asked Questions

How do I convert JSON to a C# class?+
Paste a JSON object or array into the input box. C# classes are generated instantly: each nested object becomes its own public class with get/set properties, and you can copy everything with one click.
How are JSON types mapped to C#?+
Strings become string, integers int, decimals double, booleans bool, arrays List<T>, and string-keyed maps Dictionary<string, T>. Nested objects become separate classes named after their key, e.g. address inside Root becomes RootAddress.
When is [JsonProperty] added?+
Annotations appear only when a JSON key differs from the C# property name beyond just casing — for example user_id becomes UserId with [JsonProperty("user_id")]. The using Newtonsoft.Json; directive is added automatically when needed.
Is my JSON uploaded to a server?+
No. All conversion runs locally in your browser — nothing is sent, stored, or logged.

Related Tools

JSON to C# — free online json to c#, json to csharp, json to class c#, c# class generator from json, json to poco, convert json to c# class, json to c# online, generate c# model from json, json to object c#, c# json class converter. No signup required. Works in your browser.