All Tools View Categories About Contact Privacy

IAM Policy Size Checker

Paste a policy and check its character count against all 4 IAM size limits at once.

Runs entirely in your browser — your policy JSON never leaves this page.
0
characters (whitespace excluded — what AWS measures)
0
characters as typed/pasted
Policy typeLimitResultDetail

About IAM Policy Size Checker

IAM enforces separate character-count quotas depending on how a policy document is attached — a managed policy, a role's inline policy, a user's inline policy, or a group's inline policy each has its own limit, and exceeding it produces a rejection at attach time rather than a warning while you are still editing. IAM Policy Size Checker paste your policy JSON once and shows exactly where it stands against all four limits at the same time, since the same document is often reused across more than one attachment type.

The four limits checked are the standard published AWS IAM quotas: a customer-managed policy is capped at 6,144 characters, a role's inline policy at 10,240 characters, a user's inline policy at 2,048 characters, and a group's inline policy at 5,120 characters. Because a single JSON document could plausibly be attached as any of these — the same read-only S3 policy might start life as a user inline policy and later get promoted to a managed policy shared across a team — this tool does not guess which one you mean. It shows a pass/fail result against all four, each with the limit, whether your document is currently over or under it, and by exactly how many characters it exceeds the limit when it fails.

The character count itself follows how AWS actually measures it, which surprises people the first time they see it: whitespace used purely for formatting — the indentation, the newlines between statements, the spaces around colons in a pretty-printed document — does not count against the quota. AWS strips whitespace before measuring, so a policy formatted for human readability with two-space indentation is not penalized relative to the same policy minified onto one line. This tool reports both numbers: the character count exactly as typed or pasted (what you would get from counting the raw text), and the whitespace-excluded count that AWS actually measures against the quota. All four limit comparisons use the whitespace-excluded count, since that is what determines whether AWS accepts or rejects the policy.

This is deliberately a narrow, single-purpose size calculator. It does not validate the JSON structure beyond what is needed to measure it (a JSON parse error is reported plainly, with no attempt at line/column diagnosis — the separate IAM Policy JSON Syntax Validator tool in this category handles that in depth), it does not check for overly permissive statements, duplicate statements, or wildcard usage (each of those has its own dedicated tool here too), and it does not call any AWS API to confirm the current quota values — the four numbers are the standard published limits as of this writing. If you are near a limit, the practical next steps are usually to consolidate statements that share the same Resource or Principal into fewer statements with combined Action arrays (cutting repeated JSON structural overhead), remove unused Sid values or comments-as-strings, or split one oversized document into more than one smaller policy attached separately — none of which this tool does automatically, but knowing the precise overage in characters makes it obvious how much trimming is actually needed rather than guessing.

Everything runs locally in your browser the moment you paste or click a sample; nothing is uploaded or sent to any server.

Features

  • All 4 IAM size limits checked at once — managed policy, role inline, user inline, group inline.
  • Whitespace-excluded character count, matching exactly how AWS measures policy size.
  • Raw (as-typed) character count shown alongside for reference.
  • Pass/fail per limit, with the exact overage in characters when a limit is exceeded.
  • No assumption about which attachment type you intend — see all four results together.
  • Works on minified or pretty-printed JSON identically, since the whitespace-excluded count is used for comparisons.
  • Sample multi-statement policy to see the check in action immediately.
  • Clear JSON parse errors if the pasted text is not valid JSON.
  • 100% client-side — nothing is uploaded.

How to Use

  1. Paste your policy JSON, or click "Load sample".
  2. Click Check size.
  3. Read the whitespace-excluded character count shown prominently at the top.
  4. Scan the 4-row limit table for a pass/fail per policy attachment type.
  5. For any failing limit, note the exact overage in characters shown.
  6. Trim, consolidate, or split the policy and re-check until it fits the limits you need.

Examples

Example 1 — small read-only policy. A single-statement S3 read policy comes in well under all four limits — passes across the board.

Example 2 — fits role inline, too big for user inline. A 15-statement policy with per-bucket Resource ARNs might land around 2,800 whitespace-excluded characters — over the 2,048 user inline limit by roughly 750 characters, but comfortably under the 5,120 group inline and 10,240 role inline limits.

Example 3 — too big even for a managed policy. A sprawling 60-statement policy generated by combining many services can exceed even the 6,144 managed policy limit — the fix is usually to split it into two or more smaller managed policies.

Example 4 — pretty-printed vs minified, same result. Pasting the same policy once indented with 2-space formatting and once minified onto a single line reports the identical whitespace-excluded count and identical pass/fail results, since formatting whitespace is excluded from the AWS-measured count.

Example 5 — right at the edge. A document whose whitespace-excluded count lands at exactly 2,048 characters passes the user inline limit (the limit is inclusive); one character more and it fails, reported as "over by 1 character."

Benefits

  • Checks all 4 real IAM quotas in one paste, no need to know which one applies.
  • Matches AWS's exact measurement — whitespace excluded, not raw character count.
  • Shows precise overage, not just pass/fail, so you know how much to cut.
  • Catches size problems before AWS rejects the policy at attach time.
  • Instant, local feedback — no waiting on an API call.
  • Private — policy content never leaves your browser.

Frequently Asked Questions

What character limits does this check?
All four IAM policy size quotas AWS enforces: a managed policy (6,144 characters), a role inline policy (10,240 characters), a user inline policy (2,048 characters), and a group inline policy (5,120 characters). Since the same JSON document could end up used as any of the four, all four are shown side by side rather than assuming which one you intend.
Why does the character count not match what I see when I count characters myself?
AWS counts policy size against these quotas excluding whitespace — spaces, tabs, and newlines used purely for pretty-printing do not count against the limit. This tool measures the same way AWS does, so a nicely indented policy is not penalized for its formatting; the whitespace-included count is also shown for reference.
My policy is well under 6,144 characters — is it definitely fine as a managed policy?
For the character-count quota, yes. This tool only checks size; it does not check the separate, much larger quota on the number of managed policies you can attach to a single principal, or any other IAM quota unrelated to document size.
What does "over by N characters" mean?
It is exactly how many characters (after removing whitespace) your document exceeds that specific limit by — the number you need to cut, combine, or restructure away to fit that policy type.
Does combining statements help reduce size?
Often, yes — repeated boilerplate like the same Resource ARN pattern across several statements can sometimes be consolidated into fewer statements with combined Action or Resource arrays, which reduces character count since JSON structural overhead (braces, keys) is not repeated per statement. This tool does not do that consolidation for you, but seeing the raw count highlights when it is worth trying.
Does this tool call AWS to double check?
No. It performs the same character-count arithmetic locally, in your browser, against the four published quota numbers. Nothing you paste is sent anywhere.
Can I paste minified (no-whitespace) JSON?
Yes — since the limit comparison already excludes whitespace, a minified document and a pretty-printed version of the exact same policy report the identical whitespace-excluded count and the identical pass/fail result against all four limits.
What if my JSON is not valid?
You get a clear parse-error message and no size results — fix the JSON syntax first (the separate IAM Policy JSON Syntax Validator tool can pinpoint the exact line and column).
Are these limits ever different for AWS GovCloud or China regions?
This tool uses the standard published AWS IAM quotas. Some non-standard partitions may differ; always confirm against current AWS documentation for your partition if you are unsure.