Free Base64 Encoder / Decoder Guide
July 5, 2026
Base64 is everywhere — API tokens, image data URIs, email attachments, JWT payloads, and embedded fonts. AHX's free Base64 encoder/decoder runs entirely in your browser, so you can paste sensitive tokens without leaking them to a third-party server.
What is Base64 used for?
- • Embedding images directly in HTML/CSS as data URIs (no HTTP request)
- • Encoding credentials in HTTP Basic Auth headers
- • Storing binary data in JSON (which is text-only)
- • Decoding JWT payloads to inspect auth tokens
- • Passing binary blobs through APIs that only accept text
How to encode a string to Base64
Paste your text into the encoder field. AHX uses the browser's native `btoa()` for ASCII text and a UTF-8 safe path for non-ASCII characters (emojis, CJK, accented letters). The output is RFC 4648 compliant Base64.
How to decode Base64 back to text
Paste the Base64 string. AHX auto-detects whether the result is text or binary. If it's binary (e.g. a PNG image), you'll see a preview. If it's text, you'll see the decoded string with character count.
Common pitfalls
- • Base64 is NOT encryption — it's trivially reversible. Never use it to "hide" secrets.
- • URL-safe Base64 replaces + and / with - and _ — make sure you use the right variant.
- • Base64 expands data by ~33%. A 1MB image becomes ~1.33MB of Base64 text.
- • Some APIs strip trailing = padding. AHX handles both padded and unpadded input.
Why use AHX instead of an online encoder?
Most online Base64 tools POST your input to a server. That's fine for public data, but a bad idea if you're encoding an API key or a JWT. AHX's tool runs in your browser — your data never leaves your device.