Skip to content

Guide · Open source

How to use Newtonsoft.Json: install and read or write JSON in C#

Updated · written with AI from the project's own documentation and checked against our catalogue data

Newtonsoft.Json, also called Json.NET, is a JSON framework for .NET, the Microsoft software platform. It converts JSON text into objects a C# program can work with, and back again. This guide explains what the library is for, how to get it into a project, and where to find documentation, so a C# developer can start reading and writing JSON.

Json.NETJamesNK/Newtonsoft.Json · ★ 11.3k · MIT

Quick start

  1. 1Confirm you are working in .NET. Newtonsoft.Json is a library for .NET and C#. If your project is in another language, this library will not apply.
  2. 2Add the NuGet package. Add the Newtonsoft.Json package to your project through your package manager. The package page is at nuget.org.
  3. 3Read the documentation. Open the documentation at newtonsoft.com/json/help to learn how to call the library.
  4. 4Check the licence. Read LICENSE.md in the repository to confirm the MIT terms fit your project.
  5. 5Search for answers when stuck. Use the Stack Overflow tag json.net to find questions and answers about specific problems.

What Newtonsoft.Json does

JSON is a common text format for sending data between programs. Newtonsoft.Json sits between that text and your C# code: it reads JSON into objects your program can use, and writes objects back out as JSON.

The project describes itself as a high-performance and popular JSON framework for .NET. The README is very short, so it does not list specific features beyond this.

Install Newtonsoft.Json from NuGet

The package is published on NuGet under the name Newtonsoft.Json. The project's README links to the package page at nuget.org. The README's only install command is a git clone of the repository, which gets the source code rather than adding the library to an application.

To use the library in a .NET project, add the Newtonsoft.Json package through your package manager, as you would any other NuGet package.

  • Find the package at https://www.nuget.org/packages/Newtonsoft.Json
  • Add it to the project you want to use it in
  • Clone the source only if you want to read or build the code itself
git clone https://github.com/JamesNK/Newtonsoft.Json

Find the documentation and examples

The README links to the full documentation, the homepage, the release notes and a Stack Overflow tag. Those are the places to look for usage details, since the README itself covers only links and badges.

Start with the documentation for how to call the library, then check the release notes when you upgrade and search the Stack Overflow tag when you hit a specific problem.

  • Homepage: https://www.newtonsoft.com/json
  • Documentation: https://www.newtonsoft.com/json/help
  • Release notes: https://github.com/JamesNK/Newtonsoft.Json/releases
  • Stack Overflow tag: https://stackoverflow.com/questions/tagged/json.net

Check the licence and contribution rules

The library is released under the MIT licence. The repository includes a LICENSE.md file with the full text, and a CONTRIBUTING.md file describes how to contribute.

Read LICENSE.md before shipping a product so you know the terms that apply to your use.

  • Licence: MIT (see LICENSE.md)
  • Contribution guidelines: CONTRIBUTING.md

Choose between Newtonsoft.Json and alternatives

The project is a .NET library, so it is only relevant if you write .NET or C# code. Other JSON libraries for .NET include System.Text.Json, Utf8Json, Jil and ServiceStack.Text.

The source does not compare these libraries on speed, features or security, so test the options against your own data before deciding.

  • Teams with existing code that already depends on Newtonsoft.Json
  • Teams that want a permissive MIT-licensed library
  • Teams that need a different approach can compare System.Text.Json, Utf8Json, Jil or ServiceStack.Text

What people use it for

  • Reading JSON data from an API response into C# objects
  • Writing C# objects out as JSON text to send to another program
  • Maintaining an existing .NET application that already depends on Json.NET
  • Adding JSON support to a permissively licensed (MIT) .NET project

Frequently asked questions

Is Newtonsoft.Json free to use?

The library is released under the MIT licence, a permissive open-source licence. The LICENSE.md file in the repository has the full terms. Read it to confirm it fits your project.

How do I install Newtonsoft.Json?

Add the Newtonsoft.Json package through your .NET package manager. It is published on NuGet at nuget.org/packages/Newtonsoft.Json. The README's only install command is a git clone, which fetches the source code.

What are the requirements for Newtonsoft.Json?

The README does not list any prerequisites. It is a .NET library, so you need a .NET or C# project to use it.

Where is the Newtonsoft.Json documentation?

The documentation is at https://www.newtonsoft.com/json/help, and the homepage is at https://www.newtonsoft.com/json. The README itself only links to these pages.

What are alternatives to Newtonsoft.Json?

The project lists System.Text.Json, Utf8Json, Jil and ServiceStack.Text as comparable libraries. The source does not compare their speed or features, so test them with your own data.

Where can I get help when Newtonsoft.Json is not working?

Search the json.net tag on Stack Overflow at https://stackoverflow.com/questions/tagged/json.net. The README does not describe troubleshooting steps or known limitations.

New agent skills, repos and AI tools — every week

The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.

Our verdict

Newtonsoft.Json is a good fit for C# developers who need to read or write JSON, especially teams already using it, and for projects that want an MIT-licensed library. The README is very short, so check the documentation and release notes for details. If you need a library the source does not describe, or you do not write .NET code, compare the alternatives first.

Install options & downloads