Home
Watchdroid
Mail Blackhole
JSON Formatter
JSON Viewer
JSON Compare
JSON Repair
JSON Escape & Unescape
JSONPath Tester
JSON Converter
JSON to JSON Schema
JSON to Code
JSON to TypeScript
JSON to Zod Schema
JSON Schema to Code
JSON Flatten & Unflatten
OpenAPI & Swagger Validator
blackdroid.dev

JSON to C#

Convert JSON to C# online for free — generate classes with JsonPropertyName attributes from example JSON. No upload.

C# output
// Generated by blackdroid.dev

using System.Collections.Generic;
using System.Text.Json.Serialization;

public class Root
{
    [JsonPropertyName("id")]
    public long Id { get; set; };

    [JsonPropertyName("name")]
    public string Name { get; set; } = default!;

    [JsonPropertyName("email")]
    public string Email { get; set; } = default!;

    [JsonPropertyName("active")]
    public bool Active { get; set; };

    [JsonPropertyName("balance")]
    public double Balance { get; set; };

    [JsonPropertyName("address")]
    public Address Address { get; set; };

    [JsonPropertyName("roles")]
    public List<string> Roles { get; set; };
}

public class Address
{
    [JsonPropertyName("street")]
    public string Street { get; set; } = default!;

    [JsonPropertyName("city")]
    public string City { get; set; } = default!;

    [JsonPropertyName("zip")]
    public string Zip { get; set; } = default!;
}

About JSON to C#

Paste JSON and get C# classes ready for System.Text.Json — nested objects become their own classes, arrays become List<T> and property names carry JsonPropertyName attributes where needed.

Perfect for modeling REST responses in .NET projects. Generation runs locally in your browser — your JSON is never uploaded.