# JSON Merge

> Deep-merge several JSON documents, choosing how arrays and conflicts are resolved.

JSON merge combines several documents into one, recursing into nested objects so configuration layers accumulate rather than replacing each other wholesale. Later documents win on conflict, and arrays can be replaced, concatenated or unioned depending on what you need.

**URL:** https://convertto.tech/t/json-merge
**Category:** Data & Format Tools (https://convertto.tech/c/data-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## How to use

1. Enter or paste your json documents.
2. Choose the arrays.
3. Turn "Pretty-print" on or off as needed.
4. The result appears immediately — copy or download it.

## FAQ

### What is the difference between a shallow and deep merge?

A shallow merge replaces a nested object wholesale, so merging {a:{x:1}} with {a:{y:2}} loses x. A deep merge recurses and keeps both. Configuration layering almost always wants deep; state updates often want shallow.

### Which document wins a conflict?

The later one, by convention, because configuration is normally layered as defaults first and environment overrides last. Reversing the order reverses which value survives.

## Related tools

- [.env to JSON Converter](https://convertto.tech/t/env-to-json): Convert .env files to JSON and back — for config migrations and CI variables.
- [INI & Config File Parser](https://convertto.tech/t/ini-parser): Parse INI, .conf, .cfg and .properties files into structured JSON, YAML or TOML.
- [Data Format Converter](https://convertto.tech/t/data-format-converter): Convert between JSON, YAML, XML, CSV, TSV and TOML in any direction, locally in your browser.
- [JSON Diff](https://convertto.tech/t/json-diff): Compare two JSON documents and see exactly which keys were added, removed or changed.
- [JSON Flattener](https://convertto.tech/t/json-flattener): Flatten deeply nested JSON into dot-notation keys, or expand flat keys back into nested objects.
- [JSON Formatter & Validator](https://convertto.tech/t/json-formatter): Format, validate, repair and analyse JSON — with errors that point at the exact line.
- [JSON Key Sorter](https://convertto.tech/t/json-sorter): Sort object keys and arrays in a JSON document to make two versions comparable.
- [JSON to TypeScript Converter](https://convertto.tech/t/json-to-typescript): Generate TypeScript interfaces, Zod schemas, Go structs, Python dataclasses or Rust structs from JSON.
- [.env File Validator](https://convertto.tech/t/env-file-validator): Check a .env file for syntax errors, duplicate keys, exposed secrets and missing entries.
