JSON to C# Class

Generate C# class definitions from JSON data — with properties, attributes, and nullable types

  1. Home
  2. /
  3. JSON to C# Class

Options

Generated C# Code

using System.Text.Json.Serialization;

public class User
{
    [JsonPropertyName("id")]
    public int Id { get; set; }

    [JsonPropertyName("name")]
    public string? Name { get; set; }
}

Classes

0

Properties

0

Nullable

-

Nesting

0

What Is a C# POCO?

A POCO (Plain Old CLR Object) is a simple C# class with auto-implemented properties. It's the foundation for data transfer objects, entity models, and API response models in .NET applications. With JSON serialization attributes, you can control property naming during serialization.

How to Use

  1. Paste JSON — Enter valid JSON data.
  2. Set class & namespace — Customize the output.
  3. Toggle options — JsonPropertyName attributes, nullable types.
  4. Copy or download — Save as .cs file.