Report Tool or Give Us Suggestions

JSON to C Sharp POJO Generator

Paste JSON and generate Newtonsoft.Json C# POCO classes with JsonProperty attributes in your browser.

L ading . . .

Generate strongly typed C# POCO (Plain Old CLR Object) classes from any JSON payload without leaving your browser. The generator walks the parsed JSON tree, infers primitive types (bool, long, double, string), and emits one class per nested object with [JsonProperty] attributes so deserialisation with Newtonsoft.Json preserves the original property names.

Why infer C# models from JSON?

  • REST API consumers: Drop sample responses to scaffold the DTOs your HttpClient will deserialise.
  • Migration spikes: Translate sample documents from Mongo, DynamoDB, or vendor exports into POCOs as a starting point.
  • Teaching: Show students how JSON shapes map to PascalCase C# properties.
  • Code review aid: Compare hand-written models against an automated baseline.

How types are inferred

  • JSON booleans become bool.
  • JSON numbers map to long when they are integers and double otherwise.
  • JSON strings map to string.
  • Arrays become List<T> where T is inferred from the first non-null element. Empty arrays default to List<object>.
  • Nested objects become their own classes named after the parent path in PascalCase. Duplicate class names get a numeric suffix to avoid collisions.

If you start with a JSON array at the root level the generator wraps it in a synthetic Items property so the resulting model is still a class you can deserialise directly.

Frequently Asked Questions

Which JSON library do the attributes assume?

Newtonsoft.Json (Json.NET). If you prefer System.Text.Json, replace [JsonProperty] with [JsonPropertyName] and the matching namespace import after pasting the output into your project.

How are nullable fields handled?

Fields whose only sampled value is null become object. Adjust to nullable types like int? or string? once you know the real schema.

What about really large numbers?

Integers map to long by default, which handles values up to 9,223,372,036,854,775,807. For unbounded numerics swap the type for decimal or System.Numerics.BigInteger where needed.

Does my JSON leave the browser?

No. Parsing and code generation happen entirely on your device. Nothing is uploaded.

logo OnlineMiniTools

OnlineMiniTools.com is your ultimate destination for a wide range of web-based tools, all available for free.

Feel free to reach out with any suggestions or improvements for any tool at admin@onlineminitools.com. We value your feedback and are continuously striving to enhance the tool's functionality.

© 2026 OnlineMiniTools . All rights reserved.

Hosted on Hostinger

v1.10.0