Skip to main content
Back to Tools
Web Tools

JSON to C# Class

Convert JSON data to C# class definitions with auto-properties. Infer nested classes, List types, nullable reference types, and records. Runs entirely in your browser — your data never leaves your machine.

json csharp converter class code-generator dotnet

Published May 29, 2026

All interactive tools run entirely in your browser. Your data never leaves your device.

How It Works

Paste any JSON data and instantly get C# class definitions with auto-properties. The tool infers types from values, handles nested objects, arrays, null values, and mixed types. Configure the root class name, nullable reference types, records vs classes, and auto-properties vs full property accessors.

Features

  • Auto-property generation: public string Name { get; set; } by default
  • Nullable reference types: optional object? for null values
  • Record support: generate record instead of class
  • Full property accessors: toggle to backing-field style properties
  • Nested class inference: objects within objects generate separate named classes
  • Accurate type mapping: string, int, double, bool, object, List<T>
  • List handling: homogeneous arrays get typed elements, mixed arrays use List<object>
  • using directive: System.Collections.Generic added only when List is used
  • 5 example payloads: simple, nested, array, API response, config file
  • Private: runs entirely in the browser — no data transmitted

Use Cases

  • Quickly generating C# model classes for API response data
  • Bootstrapping .NET data transfer objects from JSON fixtures
  • Converting JSON config files to typed C# POCO classes
  • Learning how JSON structures map to C# types