I had no reason to use Newtonsoft.Json in last few years. It's a good library but I don't introduce it to any of my projects anymore. System.Text.Json covered all my limited json needs Answer from Medozg on reddit.com
🌐
C# Corner
c-sharpcorner.com › article › system-text-json-vs-newtonsoft-json-a-comprehensive-comparison
System.Text.Json vs. Newtonsoft.Json: A Comprehensive Comparison
January 31, 2025 - Lacks some advanced features available in Newtonsoft.Json. A widely used third-party library for JSON processing. Rich feature set, including JObject, LINQ-to-JSON, and custom converters. Supports older .NET Framework versions. Performance is one of the primary reasons Microsoft introduced System.Text.Json.
🌐
Microsoft Learn
learn.microsoft.com › en-us › dotnet › standard › serialization › system-text-json › migrate-from-newtonsoft
Migrate from Newtonsoft.Json to System.Text.Json - .NET | Microsoft Learn
System.Text.Json is strict by default and avoids any guessing or interpretation on the caller's behalf, emphasizing deterministic behavior. The library is intentionally designed this way for performance and security.
🌐
Reddit
reddit.com › r/csharp › newtonsoft.json vs system.text.json vs json.net
r/csharp on Reddit: Newtonsoft.Json vs System.Text.Json vs Json.Net
January 26, 2021 -

Hello, can anyone explain me the differences between this three libraries ?

Can you expose advantages and disadvantages of them ?

Top answer
1 of 5
36

We are forcing ourselves to use System.Text.Json where we can, not sure we have noticed major performance increases. However, there have been several compatibility issues, where the defaults provided by Newtonsoft were not supported by System.Text.Json at the time.

Once you work through things and increment your api versions to different patterns that support the System.Text.Json use cases everything works great. If I recall the guy who made Newtonsoft started working at MS, not sure if on the json codebase though.

Advantages of Newtonsoft.Json (A.k.a Json.NET)

- Mature

- Lots of configurability

- Wide range support for use cases

Disadvantages of Newtonsoft.Json

- This applies to older packages, but several MS provided packages could never make up their mind about which newtonsoft.Json version to use, and would lock versions making it incompatible with other MS packages.

Advantages of System.Text.Json

- Supposedly new and improved (performance)

- Built into ASP.NET now

- Plug and play in most cases where Newtonsoft was used previously

Disadvantages of System.Text.Json

- Support for complex cases can be difficult to find

- This is big for us, Polymorphic (De)Serialization

- Reference loop handling is weird, newtonsoft was more graceful

2 of 5
14

json.net is just another name for newtonsoft.json

microsoft has an article detailing the differences when migrating to system.text.json:

https://docs.microsoft.com/en-us/dotnet/standard/serialization/system-text-json-migrate-from-newtonsoft-how-to?pivots=dotnet-6-0

🌐
The Seeley Coder
seeleycoder.com › home › blog › .net core json serialization changes – newtonsoft vs system.text.json
.NET Core JSON Serialization Changes - Newtonsoft vs System.Text.Json
June 24, 2020 - The crux of this issue is that prior to .NET Core 3.x, Newtonsoft is the default JSON engine. As of .NET Core 3.x, however, Microsoft switched to their implementation in System.Text.Json. If you are starting an application fresh with .NET Core 3.x you may not run into breaking changes.
🌐
Jkrussell
jkrussell.dev › home › blog › benchmarking system.text.json vs newtonsoft.json in .net 10: which wins in 2025?
Benchmarking System.Text.Json vs Newtonsoft.Json in .NET 10: Which Wins in 2025? - John Russell's Dev Blog
November 24, 2025 - Greenfield APIs, performance-sensitive, AOT/trimming: start with System.Text.Json. Heavy JSONPath/LINQ-to-JSON, exotic converters, legacy payloads: you may prefer Newtonsoft.Json.
🌐
Medium
trevormccubbin.medium.com › net-performance-analysis-newtonsoft-json-vs-system-text-json-in-net-8-34520c21d054
.NET Performance Analysis: Newtonsoft.Json vs System.Text.Json in .NET 8 | by Trevor McCubbin | Medium
February 3, 2024 - As of January 27th, 2024, Newtonsoft.Json boasts an impressive record of over 4.2 billion downloads, securing its position as the most downloaded package on NuGet. In contrast, System.Text.Json lags behind with approximately 1.8…
Find elsewhere
🌐
Kaels-kabbage
kaels-kabbage.com › posts › newtonsoft-vs-system-text-json
Newtonsoft vs System.Text.Json: Memory Allocations using BenchmarkDotNet - Kael's Kabbage
July 10, 2023 - The benchmarks are pretty clear: System.Text.Json is faster and more memory efficient. This does come with the caveat that it’s also a needy little thing as well, and I had a lot of converters and reworking constructors as per my other post ...
🌐
DEV Community
dev.to › samira_talebi_cca34ce28b8 › newtonsoftjson-vs-systemtextjson-in-net-80-which-should-you-choose-26a3
Newtonsoft.Json vs. System.Text.Json in .NET 8.0: Which Should You Choose? - DEV Community
August 5, 2024 - If performance and modern .NET integration are your top priorities, System.Text.Json is likely the better choice. However, if you need advanced JSON handling or are working with legacy code, Newtonsoft.Json’s rich feature set and maturity ...
🌐
elmah.io
blog.elmah.io › optimizing-json-serialization-in-net-newtonsoft-json-vs-system-text-json
Optimizing JSON in .NET: Newtonsoft.Json vs System.Text.Json
April 8, 2025 - System.Text.Json lacks type preservation and outputs the wrong type name. Instead, you need to define a JsonConverter, which sometimes adds complexity to the project. We discussed a few differences in the functionalities between the two libraries. Many of them are interchangeable, but for some advanced features, Newtonsoft.Json edges out due to its 14-year evolution.
🌐
Medium
medium.com › @serasiyasavan14 › newtonsoft-json-vs-system-text-json-a-deep-dive-into-json-serialization-for-net-developers-f4fc4d0815b9
Newtonsoft.Json vs. System.Text.Json: A Deep Dive into JSON Serialization for .NET Developers | by Bit by Bit Dev | Medium
December 27, 2024 - Because it is a part of the core runtime, it’s highly optimized for both serialization and deserialization, making it faster than Newtonsoft.Json in most scenarios, particularly with small-to-medium-sized data.
🌐
Itenium
itenium.be › home › blog › newtonsoft.json vs system.text.json
Newtonsoft.Json vs System.Text.Json - Itenium
April 16, 2025 - System.Text.Json (STJ) is about twice as fast as Newtonsoft.Json while only consuming 50% as much memory.
🌐
Telerik
docs.telerik.com › knowledge base › use both 'system.text.json' and 'newtonsoft.json' for serialization in asp.net core
Serializing with both 'System.Text.Json' and 'Newtonsoft. ...
See The type or namespace name NewtonsoftJsonOutputFormatter could not be found for more information on the topic. A common requirement is to use System.Text.Json for serialization, instead of the required by the Reporting REST Service serialization package Newtonsoft.Json.
🌐
GitHub
github.com › reactiveui › refit › issues › 832
feature: Enable choice between Newtonsoft.Json and System.Text.Json · Issue #832 · reactiveui/refit
December 30, 2019 - Removing the Newtonsoft.Json dependency and switching to System.Text.Json would make refit much more speed and memory efficient. It would also be an occasion for simplifying the project structure, by dropping some targets that are no longer compatible with .NET Standard 2.0.
Author   Sergio0694
Top answer
1 of 2
31

You are asking a few questions here:

  1. I am not able to find any equivalent for JObject.Parse(json);

    In .NET 6 and later the closest equivalent to LINQ to JSON is the System.Text.Json.Nodes API. This API provides a mutable JSON document object model you can use to parse arbitrary JSON:

    • JToken corresponds to JsonNode, so JToken.Parse(json) becomes JsonNode.Parse(json) or JsonSerializer.Deserialize<JsonNode>(json).
    • JObject corresponds to JsonObject so JObject.Parse(json) becomes JsonNode.Parse(json).AsObject() or JsonSerializer.Deserialize<JsonObject>(json)

    For usage details see this answer by haldo to Equivalent of JObject in System.Text.Json.

    Before .NET 6 you can use JsonDocument to parse and examine any JSON, starting with its RootElement. The root element is of type JsonElement which represents any JSON value (primitive or not) and corresponds to Newtonsoft's JToken.

    But do take note of this documentation remark:

    This class utilizes resources from pooled memory to minimize the impact of the garbage collector (GC) in high-usage scenarios. Failure to properly dispose this object will result in the memory not being returned to the pool, which will increase GC impact across various parts of the framework.

    When you need to use a JsonElement outside the lifetime of its document, you must clone it:

    Gets a JsonElement that can be safely stored beyond the lifetime of the original JsonDocument.

    Also note that JsonDocument is currently read-only and does not provide an API for creating or modifying JSON. There is an open issue Issue #39922: Writable Json DOM tracking this.

    An example of use is as follows:

    //https://learn.microsoft.com/en-us/dotnet/csharp/whats-new/csharp-8#using-declarations 
    using var doc = JsonDocument.Parse(json);
    
    //Print the property names.
    var names = doc.RootElement.EnumerateObject().Select(p => p.Name);
    Console.WriteLine("Property names: {0}", string.Join(",", names)); // Property names: status,message,Log_id,Log_status,FailureReason
    
    //Re-serialize with indentation.
    using var ms = new MemoryStream();
    using (var writer = new Utf8JsonWriter(ms, new JsonWriterOptions { Indented = true }))
    {
        doc.WriteTo(writer);
    }
    var json2 = Encoding.UTF8.GetString(ms.GetBuffer(), 0, checked((int)ms.Length));
    
    Console.WriteLine(json2);
    
  2. Also what will be the attribute JsonProperty equivalent?

    Attributes that can control JsonSerializer are placed in the System.Text.Json.Serialization namespace and inherit from an abstract base class JsonAttribute. Unlike Newtonsoft's JsonProperty, there is no omnibus attribute that can control all aspects of property serialization. Instead there are specific attributes to control specific aspects.

    As of .NET Core 3 these include:

    • [JsonPropertyNameAttribute(string)]:

      Specifies the property name that is present in the JSON when serializing and deserializing. This overrides any naming policy specified by JsonNamingPolicy.

      This is attribute you want to use to control the serialized names of your ResponseJson class:

      public class ResponseJson
      {
          [JsonPropertyName("status")]
          public bool Status { get; set; }
          [JsonPropertyName("message")]
          public string Message { get; set; }
          [JsonPropertyName("Log_id")]
          public string LogId { get; set; }
          [JsonPropertyName("Log_status")]
          public string LogStatus { get; set; }
      
          public string FailureReason { get; set; }
      }
      
    • [JsonConverterAttribute(Type)]:

      When placed on a type, the specified converter will be used unless a compatible converter is added to the JsonSerializerOptions.Converters collection or there is another JsonConverterAttribute on a property of the same type.

      Note that the documented priority of converters -- Attribute on property, then the Converters collection in options, then the Attribute on type -- differs from the documented order for Newtonsoft converters, which is the JsonConverter defined by attribute on a member, then the JsonConverter defined by an attribute on a class, and finally any converters passed to the JsonSerializer.

    • [JsonExtensionDataAttribute] - corresponds to Newtonsoft's [JsonExtensionData].

    • [JsonIgnoreAttribute] - corresponds to Newtonsoft's [JsonIgnore].

  3. When writing JSON via Utf8JsonWriter, indentation can be controlled by setting JsonWriterOptions.Indented to true or false.

    When serializing to JSON via JsonSerializer.Serialize or JsonNode.ToJsonString(), indentation can be controlled by setting JsonSerializerOptions.WriteIndented to true or false.

Demo fiddle here showing serialization with JsonSerializer and parsing with JsonDocument.

2 of 2
3

This link should get you going, snippets of which I copied below.

https://devblogs.microsoft.com/dotnet/try-the-new-system-text-json-apis/

WeatherForecast Deserialize(string json) { var options = new JsonSerializerOptions { AllowTrailingCommas = true }; return JsonSerializer.Parse<WeatherForecast>(json, options); } class WeatherForecast { public DateTimeOffset Date { get; set; } // Always in Celsius. [JsonPropertyName("temp")] public int TemperatureC { get; set; } public string Summary { get; set; } // Don't serialize this property. [JsonIgnore] public bool IsHot => TemperatureC >= 30; }

🌐
Stack Overflow
stackoverflow.com › questions › 78921825 › net-core-migration-migrating-newtonsoft-to-system-text-json
c# - .NET Core migration - migrating Newtonsoft to System.Text.Json - Stack Overflow
If I use Newtonsoft attributes and run the .NET Core API, it ignores these attributes. If I use System.Text.Json and run the .NET Standard API, it ignores these attributes.
🌐
Medium
medium.com › @razeshmsb02 › newtonsoft-json-vs-system-text-json-choosing-the-right-json-serializer-for-c-project-69a4f8a517bc
Newtonsoft.Json vs System.Text.Json: Choosing the Right JSON Serializer for C# Project | by Rajesh Kolla | Medium
June 9, 2025 - If we are working in legacy systems or need full control, stick to Newtonsoft.Json. If we’re focusing on performance, security, and modern .NET compatibility, System.Text.Json is the way to go.
🌐
Medium
isitvritra101.medium.com › newtonsoft-json-vs-system-text-json-a-senior-developers-perspective-8ae05c3c8137
Newtonsoft.Json vs System.Text.Json — A Senior Developer’s Perspective | by Is It Vritra - SDE I | Medium
January 23, 2025 - In 2023, I was leading a team working on a high-traffic microservices application processing millions of JSON messages daily and we were using Newtonsoft.Json because, well, that’s what we’d always used. right? But we started noticing memory pressure issues during peak loads. This led us to go down the path that eventually resulted in a migration to System.Text.Json
🌐
Microsoft
devblogs.microsoft.com › dev blogs › .net blog › the convenience of system.text.json
The convenience of System.Text.Json - .NET Blog
October 9, 2023 - The primary and consistent win from System.Text.Json is lower memory use. JsonSerializer and Utf8JsonReader are both great tools for specific jobs, however, JsonSerializer should be more than good enough in the vast majority of situations. Newtonsoft.Json is competitive on speed with System.Text.Json for internet web URLs (where both APIs are likely waiting on the network).