Dedupe a JSON Array
Remove duplicates from a JSON array. Compare whole values — using RFC 8785 canonical form, so {"a":1,"b":2} and {"b":2,"a":1} count as the same record — or dedupe by one or more key fields, keeping either the first or the last occurrence.
How to remove duplicates from a JSON array
- Paste a JSON array at the top level.
- Choose Whole value to drop records that are completely identical, or Specific key fields to treat records as the same when an identifier matches.
- For key mode, list the fields —
id, oremail,tenantfor a composite key. Dotted paths likeuser.idwork. - Pick whether the first or last occurrence survives. Last is what you want when the array is ordered oldest-to-newest and later records are updates.
- Copy or download the result. The status bar reports how many duplicates were dropped.
Why key order does not matter
Whole-value comparison canonicalises each element per RFC 8785 before
hashing it: keys sorted, whitespace removed, numbers in their shortest round-trip form. Two records that
differ only in key order or formatting are correctly identified as duplicates — which naive
JSON.stringify comparison gets wrong.
Note that 1 and 1.0 canonicalise identically (both become 1),
while 1 and "1" do not — a number and a string are different values.
Privacy
Nothing is uploaded. The conversion runs in this tab using your own browser's JavaScript engine — no server sees your data, and the page keeps working with the network disconnected.
FAQ
Is the original order preserved?
Yes. Surviving records stay in their original relative order. With keep last, the record occupies the position of the first occurrence but carries the last occurrence's data — so downstream code that relies on ordering is not surprised.
What if a record is missing the key field?
All records missing the field share one comparison bucket, so they dedupe against each other. The status bar does not currently separate them out — check for missing keys with Filter array using id missing first.
Can it dedupe strings or numbers rather than objects?
Yes, whole-value mode works on any element type, including arrays of plain strings or numbers.