100% local — your data never leaves your browser

JSON to C# Class Converter — Free Online Tool

Convert JSON to C# records or classes with System.Text.Json attributes, instantly in your browser. Free, private: your data never leaves your device.

Instant Private Zero cookies
Style

JSON input

C# output

Why convert JSON to C#?

Writing C# model classes for every API response by hand is slow and error-prone. Paste a sample JSON document above and get ready-to-use C# records (or classes) in milliseconds, including nested objects and arrays.

How it works

The converter parses your JSON locally and generates one record per object. Integers map to long, floats to double, arrays to List<T>. Keys that are not valid PascalCase identifiers get a [JsonPropertyName] attribute so round-tripping with System.Text.Json keeps working. Use the options above to switch between record and class style and to rename the root type.

Frequently asked questions

Is my JSON data uploaded to a server?
No. Everything runs entirely in your browser with JavaScript. Nothing is sent over the network, which makes the tool safe for sensitive data.
Should I pick record or class?
Records (C# 9+) are concise and immutable, ideal for DTOs. Switch the Style option to class if you need mutable properties with get/set, e.g. for older codebases or certain serializers.
How are snake_case keys handled?
Properties are renamed to PascalCase and the original key is preserved with a [JsonPropertyName] attribute, so System.Text.Json keeps deserializing your payload correctly.

Related converters