Data to Class

JSON to C# Class Generator

Paste JSON and get ready-to-use C# classes or records — with serializer attributes, nullable types and proper collections.

Loading JSON ↔ C#…

How it works

How to use the JSON ↔ C#

  1. Paste JSON

    Any object or array — for example an API response body.

  2. Choose your stack

    System.Text.Json or Newtonsoft attributes, classes or records, List<T> or arrays, and an optional namespace.

  3. Deserialize

    Use JsonSerializer.Deserialize<Root>(json) or JsonConvert.DeserializeObject<Root>(json).

What gets generated

Property names are converted to PascalCase and mapped back to the original JSON key with [JsonPropertyName] (or [JsonProperty]) only when they differ. Whole numbers become int or long, decimals double, optional or nullable values get ?, and ISO dates and UUIDs can become DateTimeOffset and Guid. The reverse mode reads classes, records and properties and produces sample JSON.

Built for developers

Why developers use it

  • Private by design

    Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.

  • Instant results

    Output updates as you type, with precise error locations when something is wrong.

  • Works offline

    Once loaded, the tool keeps working without a connection. Install it as an app if you like.

  • Free, no sign-up

    No accounts, no limits, no watermarks.

FAQ

Frequently asked questions

Do I need the attributes?

System.Text.Json is case-sensitive by default, so attributes guarantee the right mapping. If you use JsonSerializerDefaults.Web (camelCase), you can set Attributes to None.

Why is a property nullable?

Because the value was null in the sample, or missing from some objects in an array.

Is my data uploaded anywhere?

No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.

Keep going

Related tools

Private by design

Your data never leaves your browser.

498 free tools that run locally — no uploads, no sign-up, no tracking of what you paste. They even work offline.

  • 498free tools
  • 0bytes uploaded
  • 23categories