---
title: How do I replace NewtonSoft.Json with System.Text.
slug: how-do-i-replace-newtonsoftjson-with-systemtext
docTags: 
createdAt: 2025-06-11T20:26:20.403Z
---

Activate recommends migrating from Newtonsoft.Json to System.Text.Json when upgrading to V8.  This article will detail how to convert scripts.

1. Replace import of Newtonsoft.Json with System.Text.Json
2. Remove using Newtonsoft.Json and other namespaces.
3. Add the following using statements at the top of your script
   - using System.Text.Json;
   - using System.Text.Json.Nodes;
   - using System.Text.Json.Serialization;
4. Make the following class replacements:
   - JObject with JsonObject
   - JArray with JsonArray
   - JToken with JsonNode
   - JsonConvert.SerializeObject with JsonSerializer.Serialize

