Some AWS workflows and adjacent tooling expect a policy document (or any text) as a Base64 string rather than raw text — embedding it inside another payload, passing it through a system that only accepts opaque blobs, or matching a particular API's expected input encoding. Policy Document Base64 Encoder/Decoder converts pasted text to Base64 and back, using the browser's native btoa/atob functions so the conversion matches exactly what a browser-based script doing the same thing would produce.
Encoding accepts any text, not just policy JSON — paste a policy document, a fragment, or anything else you need encoded. Decoding validates the input before attempting to decode it: text containing characters outside the standard Base64 alphabet, or text with an invalid length/padding, is rejected with a specific error message rather than letting a raw browser exception through.
One honest caveat: btoa/atob only handle Latin1/ASCII text correctly. IAM policy JSON is virtually always plain ASCII, so this rarely matters in practice, but if your text contains non-Latin1 Unicode characters, native btoa can throw or misbehave — a limitation of the browser API this tool intentionally keeps simple rather than working around.