Data to Class

JSON to C# Class Generator

Turn a JSON sample into C# classes with properly typed, auto-implemented properties.

C# Output
Output will appear here

Generate C# classes from a JSON sample

Paste a JSON sample and get C# classes with auto-implemented properties ({ get; set; }), following standard C# PascalCase naming for properties regardless of your JSON's key casing.

What the generator produces

  • PascalCase properties with auto-implemented getters and setters, matching standard C# convention — even when your JSON uses camelCase or snake_case keys.
  • Nested classes for nested JSON objects.
  • List<T> properties for JSON arrays, with the using System.Collections.Generic; directive added automatically when needed.
  • Deduplicated classes for repeated shapes.

Typical use cases

  • Deserializing API responses: Scaffold model classes for use with System.Text.Json or Newtonsoft.Json.
  • .NET service integration: Quickly generate a starting point for a C# client consuming a JSON API.

Frequently Asked Questions

With System.Text.Json, you'll typically need to configure PropertyNamingPolicy = JsonNamingPolicy.CamelCase on your serializer options, since the generated C# properties are PascalCase per convention while your JSON keys may not be. Alternatively, add a [JsonPropertyName("originalKey")] attribute to each property by hand.
Whole numbers are typed as int; numbers with a decimal point are typed as double.
Not currently — it generates traditional classes with auto-implemented properties, which work across all modern C# versions. Converting to a record type is usually a quick manual edit if you prefer that style.
No, generation happens entirely in your browser.