JSON to C# Class
Generate C# classes with System.Text.Json attributes from sample JSON.
Runs in your browserJSON → C#
Loading tool…
Example
{"id":1}using System.Collections.Generic;
using System.Text.Json.Serialization;
public class Root
{
[JsonPropertyName("id")]
public long Id { get; set; }
}How to use the JSON to C# Class
- Paste or type your JSON into the input area, or open a file from your device.
- Adjust the options above the editor if the tool offers any.
- Review the C# result, then copy it or download it as a file.
Privacy and limitations
- Your data is processed on your device and is not uploaded to any server.
Related converters
JSON to Java ClassGenerate Java POJO classes with Jackson annotations, getters and setters from sample JSON.JSON to Go StructGenerate Go struct definitions with json tags from sample JSON.JSON to Python DataclassGenerate Python dataclasses with type hints from sample JSON.JSON to TypeScript InterfaceGenerate TypeScript interfaces from sample JSON, with optional properties inferred from arrays.JSON to JSON SchemaInfer a draft 2020-12 JSON Schema from a sample JSON document.JSON to SQL ConverterGenerate SQL INSERT statements from a JSON array of objects, with proper quoting and NULLs.JSON to Query StringConvert a JSON object into a URL-encoded query string. Arrays become repeated keys.JSON to Markdown TableConvert a JSON array of objects into a GitHub-flavoured Markdown table.