JSON to C#
About this tool
Hand-writing C# classes from a payload misses fields. Paste JSON to generate classes. Enable Newtonsoft.Json, System.Text.Json, or record as needed. Use the online cURL generator for HTTP commands.
Features
- Emits a class or record
- Newtonsoft or System.Text.Json attributes
- PascalCase property names
How to use
- Paste a JSON sample and set the class name, for example User.
- Optionally enable Newtonsoft.Json, System.Text.Json, or record.
- Copy the C# class into your project.
When to use it
- A .NET service needs a DTO from JSON
- The project uses System.Text.Json
- You want an immutable record
Examples
- {"user_id":1} becomes UserId.
- Record mode emits a record instead of a class.
FAQ
Is the JSON uploaded?
No. Generation stays in the browser.
How is this different from the online cURL generator?
This page builds a C# class from JSON. The online cURL generator turns an HTTP request into a curl command.
Back to JSON Tools Hub