How it works
How to use the JSON ↔ C#
Paste JSON
Any object or array — for example an API response body.
Choose your stack
System.Text.Json or Newtonsoft attributes, classes or records, List<T> or arrays, and an optional namespace.
Deserialize
Use JsonSerializer.Deserialize<Root>(json) or JsonConvert.DeserializeObject<Root>(json).
What gets generated
Property names are converted to PascalCase and mapped back to the original JSON key with [JsonPropertyName] (or [JsonProperty]) only when they differ. Whole numbers become int or long, decimals double, optional or nullable values get ?, and ISO dates and UUIDs can become DateTimeOffset and Guid. The reverse mode reads classes, records and properties and produces sample JSON.
Built for developers
Why developers use it
Private by design
Runs 100% in your browser. Nothing you paste is uploaded, logged or stored on a server.
Instant results
Output updates as you type, with precise error locations when something is wrong.
Works offline
Once loaded, the tool keeps working without a connection. Install it as an app if you like.
Free, no sign-up
No accounts, no limits, no watermarks.
FAQ
Frequently asked questions
Do I need the attributes?
System.Text.Json is case-sensitive by default, so attributes guarantee the right mapping. If you use JsonSerializerDefaults.Web (camelCase), you can set Attributes to None.
Why is a property nullable?
Because the value was null in the sample, or missing from some objects in an array.
Is my data uploaded anywhere?
No. This tool runs entirely in your browser. Your input never leaves your device, is not logged, and works offline once the page has loaded.
Keep going
Related tools
- JSON ↔ TypeScriptGenerate TypeScript interfaces from JSON (and back)
- JSON Schema GeneratorInfer a JSON Schema from sample JSON
- JSON to PythonGenerate Python classes from JSON
- JSON to GoGenerate Go classes from JSON
- JSON ↔ JavaGenerate Java POJOs, Lombok classes or records from JSON
- JSON to RustGenerate Rust classes from JSON
- JSON FormatterFormat, validate and explore JSON
- JSON ValidatorFind and fix JSON syntax errors