Advertisements

headerup to 320x100 / 728x90

JSON to C# Class Generator

Convert JSON payloads to C# classes with List<T> and proper PascalCase property names

Root class:
Input
Loading editor...
Output

Output will appear here...

Advertisements

content bottomup to 300x250

What is JSON to C# Class Generator

Last reviewed:

JSON (JavaScript Object Notation) is a lightweight, human-readable data format used almost everywhere on the web for APIs, config files, and log output.

JSON to C# Class Generator infers types from your JSON and emits idiomatic C# classes with PascalCase property names, `List<T>` for arrays, and nested classes for nested objects.

Perfect for scaffolding DTOs in ASP.NET, Unity, or any .NET project consuming JSON APIs.

Why use it

  • Scaffold DTOs for ASP.NET services.
  • Port TypeScript models to .NET.
  • Generate JSON decode targets for Unity.
  • Teach C# property conventions.
  • Accelerate prototype services.

Features

  • PascalCase properties
  • List<T> for JSON arrays
  • Nested class support
  • System.Collections.Generic using
  • JSON to C# Class Generator is handled entirely in-browser

How to use JSON to C# Class Generator

  1. Paste JSON. Any object or array-of-objects.
  2. Set root class. Via toolbar.
  3. Run. Copy the C# classes.

Example (before/after)

JSON

{ "accountId": "A-7001", "balance": 1450.75, "features": ["wire", "ach"] }

C#

using System.Collections.Generic;

public class Account
{
    public string AccountId { get; set; }
    public decimal Balance { get; set; }
    public List<string> Features { get; set; }
}

Common errors

Attribute annotations

No [JsonPropertyName] attributes are emitted.

Fix: Add them manually if you need non-default names.

Nullable reference types

C# 8+ nullable references aren't emitted by default.

Fix: Add `?` to reference types manually.

FAQ

Does it add JSON attributes?

No — PascalCase properties only. Add [JsonPropertyName] manually for snake_case JSON.

Are nested objects generated?

Yes — each nested object becomes its own class.

Does it use records?

Not by default — classes with auto-properties.

Is it C# 10+ friendly?

Yes — compiles on every recent .NET version.

Is input uploaded?

No — C# classes are emitted locally in your browser from the pasted JSON.

Related tools

Pair with other POJO generators and JSON tools. You can also browse the full POJO & Schema Generators category for more options.