JSON to C# and TypeScript Converter
Paste JSON, press Generate models, and get C# classes or TypeScript interfaces. Nested objects become their own types, arrays become typed collections, and fields that are sometimes missing come out nullable or optional. Runs in your browser: free, no sign-up, nothing uploaded.
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.
What this JSON converter does
It reads a sample of your JSON and writes the types that would hold it. Objects become named types, entries in an array are combined so every field is found, and the original keys are kept with JsonPropertyName attributes in C#.
C# output uses nullable annotations and System.Text.Json (C# 8 or later); TypeScript output marks fields missing from some objects as optional.
Check before you commit
Types come from the sample, not a schema. A number that is always whole looks like an int, dates stay strings, and empty arrays or null-only fields need a decision from you.
Paste a representative response, review the names that had to be adjusted, and the models drop straight into your project.
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.