Loading…
Loading…
Paste JSON and get C# model classes or records, ready for System.Text.Json or Newtonsoft.Json. Nested objects, arrays, nullable types, dates, and GUIDs are inferred for you.
C# classes appear here as you type. Paste a JSON object or an array of objects — or click Sample.
Paste an API response, upload a .json file, or load it from a URL. Use a real payload rather than a hand-written one: the more complete the sample, the more accurate the inferred types. For arrays, include several items so optional fields show up.
Name the root class and optionally set a file-scoped namespace. Then choose classes or records, System.Text.Json or Newtonsoft.Json attributes, List<T> or arrays, and double or decimal for fractional numbers.
A null or a key missing from some array items becomes nullable. ISO 8601 strings become DateTime (or DateTimeOffset when they carry an offset), GUID-shaped strings become Guid, and identical object shapes share one class.
Copy the code or download it as a .cs file, then deserialize with JsonSerializer.Deserialize<Root>(json), or JsonConvert.DeserializeObject<Root>(json) for Newtonsoft.
No. Type inference and code generation run entirely in your browser, so you can paste production payloads, internal API contracts, or customer data without them leaving your machine.
Use System.Text.Json for new .NET projects. It ships with the runtime, it's faster, and ASP.NET Core uses it by default. Pick Newtonsoft.Json when the project already depends on it, for example older ASP.NET MVC code or libraries that expose JObject. The attributes keep the original JSON key, so snake_case or other naming styles still map onto PascalCase properties.
A property becomes nullable when the sample has a null for it, or when it's missing from some of the objects in an array. Value types (int, bool, DateTime, Guid) always get the ? in that case. With Nullable reference types on, string, list, and class properties are annotated too, and the ones that are always present get an initializer (string.Empty, [], or new()), so the code compiles without CS8618 warnings.
Types come from the sample you paste. A price that happens to be 250 in every item reads as an integer, and JSON itself doesn't distinguish 250 from 250.0. Add an item with a fractional value, or change the property to decimal by hand. For money, set Decimals to decimal so fractional numbers never become double.
If the root is an array of objects, the items are merged into one class and a comment tells you to deserialize as List<Root>. When a property holds different kinds of values across items (a number in one, a string in another), it becomes object, because there's no single C# type that fits. Numbers that mix whole and fractional values widen to double or decimal instead.
Data
Format, validate, and minify JSON in your browser. Paste it, upload a file, or load it from a URL. Errors show the exact line and column.
SQL
Format and beautify SQL queries for SQL Server (T-SQL), PostgreSQL, MySQL, Oracle, and more. Set the indentation, keyword case, and layout, and get the exact line of any syntax error.
Images
Preview SVG code live and safely, check its size and viewBox, fix common errors, and export it as PNG, a data URI, a CSS background, or an <img> tag.
Text
Compare two texts or code files side by side, with changed words highlighted. Ignore whitespace or case, and export a unified .diff patch that git apply accepts.
Images
Create QR codes for links, Wi-Fi logins, email, phone, and SMS. Set error correction and colors, then download a crisp SVG or PNG. Static codes, no tracking, no sign-up.