Skip to content
ENExplore Calculators

IAM Policy Size Calculator

Size an IAM policy document against its character limit and see how many statements still fit before you must split it.

About IAM Policy Size Calculator

The document overhead covers the Version element and the outer JSON wrapper, then each statement contributes its Sid, Effect, Action, Resource and Condition characters. Dividing the remaining budget by the average statement length tells you how many more statements the same document can hold. Policy character limits are hard quotas: a deploy that pushes a policy one character over the limit fails with LimitExceeded, usually in the middle of a change window.

Formulas

IAM Policy Size

policy size = statements × characters per statement + document overhead, and utilisation = size ÷ the limit for that policy type.

overhead
Version, wrapper and bracket characters outside the statements
utilisation
Fraction of the character limit consumed

AWS IAM character limits

Managed policy 6144 characters; aggregate inline policy 2048 (user), 5120 (group), 10240 (role).

6144
Hard limit on a single customer or AWS managed policy

Worked example

With the default values below, IAM Policy Size Calculator returns Policy Document Size of 4,605. Change any input above and every figure here is recalculated in your browser.

Inputs used

Statements in the policyaccepts 1–500 statements
12 statements
Average characters per statementaccepts 40–4,000 characters
380 characters
Policy type and its character limitone of Managed policy — 6144, Inline policy on a role — 10240, Inline policy on a group — 5120, Inline policy on a user — 2048
Managed policy — 6144
Whitespace you could stripaccepts 0–60 %
18 %

Results

Policy Document Size
4,605 characters
Character Limit
6,144 characters
Headroom Remaining
1,539 characters
Limit Utilisation
75.0%
Size After Minifying
3,776 characters
Statements That Fit
16
Assessment
Comfortably within limit

Step by step

  1. 1Values used
  2. 2IAM Policy Size
  3. 3AWS IAM character limits
  4. 4Policy Document Size= 4,605 characters
  5. 5Character Limit= 6,144 characters
  6. 6Headroom Remaining= 1,539 characters
  7. 7Limit Utilisation= 75.0
  8. 8Size After Minifying= 3,776 characters
  9. 9Statements That Fit= 16

Assumptions and limits

  • The result is derived only from the 4 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 1 decimal place, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

How is IAM Policy Size calculated?

policy size = statements × characters per statement + document overhead, and utilisation = size ÷ the limit for that policy type. The document overhead covers the Version element and the outer JSON wrapper, then each statement contributes its Sid, Effect, Action, Resource and Condition characters. Dividing the remaining budget by the average statement length tells you how many more statements the same document can hold.

Why does IAM Policy Size matter?

Policy character limits are hard quotas: a deploy that pushes a policy one character over the limit fails with LimitExceeded, usually in the middle of a change window.

What values do I need to enter?

This calculator takes 4 inputs: Statements in the policy, Average characters per statement, Policy type and its character limit, Whitespace you could strip. The pre-filled defaults are a realistic starting point — replace them with figures from your own environment for a result you can act on.

Does whitespace count toward the AWS policy size limit?

No. AWS states that whitespace is not counted when it measures a policy against the character limit, so pretty-printing your JSON is free. Everything else — Sids, long ARNs, condition keys — does count, which is why the minified figure here is a floor rather than the number AWS enforces.

What do I do when a policy will not fit?

Split it across several managed policies (up to 10 can attach to one role by default, raisable to 20), replace enumerated resource ARNs with wildcards or paths, drop Sid strings, and move repeated conditions into a permissions boundary or SCP instead of duplicating them per statement.

IAM Policy Size Calculator – Calculate Policy Document Size