JSON to C#

Paste JSON and instantly get matching C# class definitions with public properties and nested classes.

Input JSON

C# Output

Paste JSON and click Generate

Copied!

Summary

Paste JSON and instantly get matching C# class definitions with public properties and nested classes.

How it works

  1. Paste or type JSON into the input panel, or load a sample.
  2. Set a root class name (defaults to RootObject).
  3. Click Generate to parse the JSON and build C# classes.
  4. Nested objects become their own named classes; arrays of objects are scanned across all items to collect every property.
  5. Review the generated classes, each with public auto-properties, in the output panel.
  6. Click Copy to copy the C# code to your clipboard.

Use cases

  • Scaffold a POCO for an incoming REST API response before writing a deserializer.
  • Turn a sample config file into a typed C# settings class.
  • Generate a starting class for System.Text.Json or Newtonsoft.Json without typing every property by hand.
  • Document a third-party API response shape as C# types.
  • Speed up building a .NET client for an API that only ships JSON examples.
  • Check property naming and nesting before hand-writing a data model.

Frequently Asked Questions

Last updated: 2026-07-23 · Reviewed by Nham Vu