All Tools View Categories About Contact Privacy

IAM Policy Comparison Tool

Diff two IAM policy documents statement by statement — see what was added, removed, or unchanged.

Runs entirely in your browser — neither policy is uploaded.

Removed (only in Policy A)


    

Added (only in Policy B)


    

Unchanged (in both)


  

About IAM Policy Comparison Tool

Two IAM policy JSON documents can look nearly identical at a glance and still differ in exactly one statement buried in the middle of a long array, or they can be reformatted with different key order and whitespace while being functionally identical. IAM Policy Comparison Tool compares two pasted policy documents statement by statement and reports exactly which statements were added, which were removed, and which are common to both — so you can see the real change between two policy versions instead of eyeballing a wall of JSON.

The comparison is structural, not textual: each statement is reduced to a canonical form — its Effect, its Action/NotAction list sorted, its Resource/NotResource list sorted, its Condition block, and its Principal/NotPrincipal — before being compared. That means a statement with its Sid renamed, or with its keys reordered, or with its Action array listed in a different order, is correctly recognized as unchanged. A statement is only reported as different if something that actually affects policy evaluation changed.

What this tool deliberately does not do is semantic comparison. If Policy A grants s3:Get* and Policy B grants the equivalent-in-practice s3:GetObject plus s3:GetObjectVersion written out explicitly, those are two different statements as far as this tool is concerned — it does not attempt to reason about whether one wildcard pattern subsumes another set of literal actions. That kind of "does this specific request end up allowed" question is exactly what the separate IAM Policy Simulator tool answers; this tool answers the narrower, purely structural question of what changed between two documents.

The result is broken into three lists: statements only in Policy A (removed), statements only in Policy B (added), and statements present in both (unchanged) — with a one-line identical/different verdict at the top so you can tell at a glance whether a policy edit actually changed anything.

Features

  • Statement-level diff between two pasted policy documents.
  • Order-independent comparison — Action/Resource lists compared as sets, Sid and key order ignored.
  • Added / removed / unchanged statement lists, each shown in full.
  • Identical / different verdict at a glance.
  • Works with any statement count on either side.
  • Sample before/after pair to see the tool in action immediately.
  • 100% client-side — neither policy is uploaded.

How to Use

  1. Paste Policy A (the "before" version) on the left.
  2. Paste Policy B (the "after" version) on the right, or click the sample pair.
  3. Click Compare.
  4. Read the verdict — identical, or how many statements were added/removed.
  5. Review the added/removed statement lists to see exactly what changed.

Examples

Example 1 — a permission was added. Policy B has every statement from Policy A plus one new s3:PutObject Allow statement → reported as 1 added, 0 removed.

Example 2 — reformatted but unchanged. Policy B is Policy A with different indentation and Sid names → reported as identical.

Example 3 — a Deny was removed. Policy B drops an explicit Deny statement that was present in Policy A → reported as 1 removed.

Benefits

  • Finds the real change between two policy versions without manual line-by-line comparison.
  • Ignores cosmetic differences — key order, whitespace, Sid renames.
  • Clear added/removed/unchanged breakdown instead of a raw text diff.
  • Private — both documents stay in your browser.

Frequently Asked Questions

How does it decide two statements are "the same"?
Effect, Action(s), Resource(s), Condition, and Principal must all match exactly (Actions/Resources are compared as sets, so order does not matter). <code>Sid</code> and the raw JSON key order are ignored, since neither changes what the policy actually does.
Is this a semantic diff — does it know that <code>s3:Get*</code> covers <code>s3:GetObject</code>?
No. This is a structural diff, not a semantic one. <code>Action: ["s3:Get*"]</code> and <code>Action: ["s3:GetObject", "s3:GetObjectVersion"]</code> are reported as different statements even though the first may cover the second in practice. If you need to know whether two specific action/resource combinations resolve the same way, use the IAM Policy Simulator instead.
What counts as "added" vs "removed"?
A statement present in Policy B but not (by the exact-match rule above) in Policy A is listed as added. A statement present in Policy A but not in Policy B is listed as removed. There is no "modified" category — a statement that changed in any field shows up as one removed statement and one added statement.
Can I compare policies with a different number of statements?
Yes — the two documents do not need the same statement count. "Identical" only reports true when both the added and removed lists are empty and both documents have the same total statement count.
Does it check Version or other top-level fields?
No, only the <code>Statement</code> array is compared. A change to <code>Version</code> alone (e.g. from the legacy <code>2008-10-17</code> to <code>2012-10-17</code>) is not reflected in this diff.
Is either policy sent anywhere?
No — the comparison runs entirely in your browser.