Convert Json To C# Class

JSON is a popular alternative to XML where an object is stored in a string that can be deserialised and loaded into a class of any language that has a JSON parser to support it. .NET supports a dynamic class type that will allow you to load the JSON string into a dynamic class that does not have to be defined in advance. It does leave your code open to exceptions if variable naming is not kept consistent.

If you want to use defined classes for deserialising JSON, the tool below will allow you to convert JSON to a C# class. Paste the JSON string of an object into the box below and it will convert it to a C# class for you.

Paste JSON string into Box Below

Unsupported Variable Names In C#

C# does not allow variable names that conflict with reserved words for the language. Words such as object, string etc can’t be used as variable names in C# and if they are used in the JSON object that you provide, they will be removed.

 

Related Tools

Base 64 Encode

Base 64 encoding tool that will convert any piece of text you provide into a valid base 64 string using standard encoding

GUID Validator

Free online guid validator. Provide a guid and verify if the value is a valid ID and is formatted correctly

GUID Generator

Free online GUID generator. This tool will allow you to create an endless amount of random GUID values to use in your project.

Base 64 Decode

Base 64 decode tool will allow you to enter a piece of encoded text and it will provide you with the decoded version of the text.

JavaScript Multi-line String Builder

Tool that will take a piece of text and convert it into a multi line string that you can use in your javascript application.

Replace Extended ASCII Characters With Standard Characters

Online tool to replace extended ASCII characters with standard characters. Remove accents from letters and replace with standard letters.

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.