# JSON Patch Tool

Apply JSON Patch operations to JSON data (RFC 6902)

> Canonical page: https://elysiatools.com/en/tools/json-patch

- **Category:** Converter

- **Keywords:** json, patch, rfc 6902, modify, update, operations, edit, transform

## Overview

The JSON Patch tool allows you to precisely modify, update, or transform JSON documents by applying a sequence of operations defined by the RFC 6902 standard.

## Inputs

- **Original JSON** (textarea): {"name": "John", "age": 30, "hobbies": \["reading"\]}
- **Patch Operations** (textarea): \[{"op": "replace", "path": "/age", "value": 31}\]

## When to use

- When you need to apply specific, programmatic changes to a large JSON object without rewriting the entire file.
- When you are working with API responses and need to test how specific updates affect the data structure.
- When you want to maintain a clean, version-controlled history of changes to your configuration files.

## How it works

- Paste your original JSON document into the 'Original JSON' input field.
- Define your modifications using the standard JSON Patch format (RFC 6902) in the 'Patch Operations' field.
- Click the process button to apply the operations and generate the updated JSON output.

## Use cases

- Updating specific configuration values in a large JSON settings file.
- Removing deprecated fields from a legacy API response structure.
- Adding new items to an existing array within a JSON data object.

## Frequently asked questions

### What is JSON Patch?

JSON Patch is a standard format (RFC 6902) for describing changes to a JSON document, allowing for efficient updates.

### Which operations are supported?

The tool supports all standard RFC 6902 operations, including add, remove, replace, move, copy, and test.

### Can I apply multiple operations at once?

Yes, you can provide an array of operations in the 'Patch Operations' field to perform multiple edits in a single pass.

### Is my data stored on your server?

No, all processing is performed locally in your browser to ensure your data remains private and secure.

### What happens if an operation fails?

If an operation is invalid or the path does not exist, the tool will return an error message indicating the specific operation that failed.

## Related tools

- [JSON Pointer Tool](https://elysiatools.com/en/tools/json-pointer): Navigate and extract values from JSON using JSON Pointer (RFC 6901)
- [CSON to JSON Converter](https://elysiatools.com/en/tools/cson-to-json): Convert CSON (CoffeeScript Object Notation) data to JSON format
- [EDN to JSON Converter](https://elysiatools.com/en/tools/edn-to-json): Convert EDN (Extensible Data Notation) data to JSON format
- [GraphQL to JSON Converter](https://elysiatools.com/en/tools/graphql-to-json): Convert GraphQL query or response data to JSON format
- [JSON to C# Class Converter](https://elysiatools.com/en/tools/json-to-csharp): Convert JSON data into C# classes with PascalCase properties, JsonPropertyName attributes, and nested type inference
- [JSON to CSON Converter](https://elysiatools.com/en/tools/json-to-cson): Convert JSON data to CSON (CoffeeScript Object Notation) format
- [JSON to CSV Converter](https://elysiatools.com/en/tools/json-to-csv): Convert JSON data to CSV format with customizable formatting options
- [JSON to EDN Converter](https://elysiatools.com/en/tools/json-to-edn): Convert JSON data to EDN (Extensible Data Notation) format

## Samples

- [Terraform Plan JSON Samples](https://elysiatools.com/en/samples/terraform-plan-json-samples): Sample Terraform plan JSON files exported from terraform show -json style payloads for dependency visualization and change review
- [Chat Transcript JSON Samples](https://elysiatools.com/en/samples/chat-transcript-json): JSON examples for multi-role chat transcripts
- [JSON Samples](https://elysiatools.com/en/samples/json): JSON (JavaScript Object Notation) format examples from simple to complex structures
- [Rich Media JSON Samples](https://elysiatools.com/en/samples/rich-media-json): JSON examples for popular rich text editors (TipTap, Quill, Slate)
