TOML Merge
Combine a base TOML document with an overlay. Deeply merges nested tables; arrays and conflicts resolve by the policy you pick.
When to merge
Useful for layered configuration: a shared base.toml and a per-environment prod.toml, defaults plus user overrides, or a generated file plus hand-edits. The merge is recursive — nested tables combine instead of overwriting each other wholesale.
How to use it
- Paste the base TOML on the left, the overlay on the right.
- Pick a conflict policy: overlay-wins (B), base-wins (A), or error.
- Pick an array policy: replace, concat, or union.
- Click Merge. Auto-runs as you type.
Conflict and array policy
- Overlay wins (default). When both sides have a value at the same path, B wins. Think "user overrides base."
- Base wins. A wins ties. Think "frozen defaults plus optional additions."
- Error. Stops and reports if values differ — useful for sanity-checking that two configs are compatible.
- Arrays: replace. The whole array is replaced (TOML's natural behavior).
- Arrays: concat. A's items first, then B's items.
- Arrays: union. Deduplicates by JSON-equality.
FAQ
How are arrays of tables merged?
As arrays — same policy as scalar arrays. Replace gives you B's array; concat appends; union removes structural duplicates.
Does it preserve key order?
By default yes — base keys first, then new keys from the overlay. Pick the Sort dropdown if you want alphabetical instead.
Where do comments go?
They're dropped — the merge happens on parsed values, not on text. Use a textual merge tool if you need to keep comments.