JSON to C#
Convert JSON data to C# class using quicktype engine. Supports NewtonSoft/System.Text.Json framework switching and rich code generation options.
Usage
Features
Based on quicktype engine, this tool automatically converts JSON data to C# class definitions with type inference, framework switching, and namespace configuration.
Steps
Enter or paste JSON data in the left text box, set the root type name and generation options. C# code will be generated in real time on the right.
Configuration
- Serialization framework: NewtonSoft (default, generates JsonProperty attributes) or System.Text.Json (generates JsonPropertyName attributes).
- !Array type: List<T> or T[], controls the C# type of array fields.
- Output features: complete (full converter + attributes), attributes-only, just-types-and-namespace, or just-types.
- Number type: double or decimal, controls the C# type of floating-point fields.
- Any type: object or dynamic, controls the C# type of any fields.
- C# version: 5 or 6, affects which syntax features are used in the generated code.
- Base class: Object (default) or EntityData, controls the base class of generated classes.
Notes
Number types are automatically inferred as long or double. null values are inferred as object. Nested objects generate corresponding nested class definitions.
Related tools
More from the same category · Developer Tools
Cron ExpressionVisual Cron builder: pick minute-hour-day-month-weekday fields and preview next run times live.JSON FormatterJSON beautify, minify and validate with auto error location for missing brackets and stray commas.Timestamp ConverterConvert Unix timestamps to dates and back with second/millisecond precision and live current time.Regex TesterTest regex with live match highlighting, capture groups and substitution, toggling g/i/m/s flags.JWT ParserSplit a JWT into header, payload and signature, then base64url-decode claims and expiry without a key.JWT GeneratorIssue JWTs with custom header, claims and expiry across HS256, RS256, ES256 for auth-flow testing.