Policies assembled by merging JSON snippets from multiple sources, or built by copy-pasting an existing statement as a starting point for a new one, frequently end up with two statements that are byte-for-byte identical — same Effect, same Action, same Resource, same everything. Policy Statement Duplicate Detector paste a policy JSON document and it finds every exact duplicate statement pair, telling you which statement index is the original and which is the redundant copy.
The comparison is a deep, exact-content check: each statement's keys are normalized to a consistent order and compared as JSON, so two statements are only flagged as duplicates when their Effect, Action (or NotAction), Resource (or NotResource), Sid, Condition, and every other field match exactly. This is deliberately conservative — it finds statements that are truly redundant (removing the later copy changes nothing about what the policy allows or denies) rather than statements that merely look similar or grant overlapping access.
There is one limitation worth being upfront about, because it is easy to assume the tool catches more than it does: array element order matters to the comparison. A statement with "Action": ["s3:GetObject", "s3:ListBucket"] and another with "Action": ["s3:ListBucket", "s3:GetObject"] grant identical permissions in practice, but this tool does NOT flag them as duplicates, because the underlying check compares the JSON content as-is, including array ordering, rather than treating arrays as unordered sets. The same applies to Resource arrays. If a policy was assembled by hand and you suspect there may be near-duplicates that differ only in list ordering, a manual side-by-side read is still worth doing — this tool's guarantee is specifically about exact, literal duplicates, not semantically-equivalent-but-reordered ones.
When duplicates are found, each is reported as a pair: the index of the first (earliest) occurrence and the index of the later, redundant occurrence. If the identical statement content appears three or more times, every later occurrence is paired against that same first occurrence, so a triple-duplicate shows up as two separate pairs rather than being silently collapsed or missed. Because an exact duplicate by definition grants nothing its twin does not already grant, removing every "duplicate" side of a reported pair is always safe from a permissions standpoint — it only shrinks the document and improves readability, which also helps if the policy is close to one of IAM's character-count size limits (see the separate IAM Policy Size Checker tool in this category for that).
This tool is intentionally narrow: it does not detect statements that are merely redundant in effect but different in content (e.g. one statement's Resource being a superset of another's), does not rewrite or merge your policy, and does not call any AWS API. It runs the comparison entirely in your browser the moment you paste a document or click the sample, and nothing you paste is ever sent anywhere.