#

JSON to C#

Convert JSON to C# classes with JsonPropertyName attributes. Nested objects become classes and numbers map to int or double. Runs entirely in your browser.

Paste JSON and click Generate to produce C# classes.

JSON input
Generated C#

What this tool does

This JSON to C# converter takes a JSON document and generates C# type definitions from its shape. It runs entirely in your browser — your data never leaves the page.

How it works

1. Infer types. Every value is inspected: strings, numbers, booleans, null, arrays and nested objects.
2. Merge shapes. Array items are merged so optional fields stay optional.
3. Name fields. Keys become valid target-language identifiers.
4. Emit code. C# definitions preserve original JSON keys.

Frequently asked questions

What attributes are generated?

JsonPropertyName attributes preserve the original JSON keys.

How are numbers mapped?

Integers become int and decimals become double.

Does JSON to C# upload my data?

No. JSON to C# runs entirely in your browser — your input never leaves this page.

Is JSON to C# free to use?

Yes. JSON to C# is completely free, with no account and nothing to sign up for.

Updated 2026-08-07 · Runs in your browser — your data never leaves this page.