Generate C# classes or TypeScript interfaces from JSON, including nested objects and arrays.
DEVELOPER TOOLS · RUNS IN YOUR BROWSER
JSON to C# / TypeScript
Turn sample JSON into typed models. Nested objects, arrays, and nullable fields included.
Paste JSON or load the example to begin.
Your JSON stays in this browser. No upload, account, or API key required. Maximum input: 1 MB.
How to use it
1Paste JSON
A single object or an array of objects, straight from an API response.
2Pick the output
C# classes or TypeScript interfaces, with a root type name of your choosing.
3Copy into your project
Nested objects become their own types, and arrays become typed collections.
Good to know
Types come from the sample
A field is typed from the values present. A number that is always whole looks like an int, so check fields that could be decimal.
Nullable and optional
Nulls and fields missing from some objects are marked nullable or optional rather than being dropped.
Names are made valid
Keys that are not valid identifiers are adjusted, so review the property names before committing.
Nothing is uploaded
The JSON stays in your browser, which matters for real payloads.
Common uses
Creating models for a new API integration
Typing a webhook payload
Turning a config file into strongly typed settings
Generating TypeScript interfaces for a front end
Sketching DTOs from a sample response
Questions
Does it handle nested objects and arrays?
Yes. Nested objects become separate types and arrays become lists of the element type.
What about fields that are sometimes missing?
They are generated as nullable or optional, so deserialisation does not fail when they are absent.
Will the types always be right?
They reflect the sample you paste. Provide a representative example, and double-check numeric fields that may be decimal in production.
Is my JSON sent to a server?
No. The models are generated in your browser.
Designed for real JSON
Objects become named types. Array entries are combined to discover all fields. Missing TypeScript properties become optional; nullable C# properties preserve nulls. Original JSON keys are retained with JsonPropertyName attributes.
A starting point for your code
Types are inferred from your examples, not a complete schema. Dates remain strings. Review empty arrays, null-only fields, mixed types, and large numbers. C# output uses nullable annotations and System.Text.Json (C# 8 or later).