JSON to C#

Generate C# model classes from JSON data in your browser.

Generate C# model classes from JSON with nested objects, arrays, and System.Text.Json property mapping.

How to use

  1. Paste valid JSON.
  2. Generate the C# models.
  3. Review property names, nullable fields, and the serializer used by your project before copying.

Examples

Object to C# model

Input

{"id":1,"name":"demo","enabled":true}

Output

public class Root
{
    public long Id { get; set; }
    public string Name { get; set; }
    public bool Enabled { get; set; }
}
Privacy
May contact server Avoid sensitive data Uploads only when needed

Conversion runs entirely in your browser and does not upload JSON.

Frequently asked questions

When needed, generated code uses System.Text.Json.Serialization.JsonPropertyName for original JSON keys.

Arrays become List<T>, and nested objects become separate model classes.
Next steps

Related tools

After finishing this task, continue with these related tools.