RevealTheme logo

Base64 Encoder & Decoder

Encode text to standard Base64 or decode standard Base64 back to text, with full UTF-8 support. Runs entirely in your browser — nothing is uploaded.

How to use this tool

  1. 1

    Click Encode to turn text into Base64, or Decode to turn Base64 back into text.

  2. 2

    Type or paste your input into the text box (it starts with a sample value you can replace).

  3. 3

    Press Run to process the input; the result appears in the box below.

  4. 4

    If decoding fails, check the error message — invalid Base64 characters or wrong padding are the usual causes.

What is Base64 and why is it everywhere?

Base64 is an encoding scheme — not encryption — that represents binary data using 64 printable ASCII characters: A-Z, a-z, 0-9, plus + and /, with = used for padding. It exists because many channels are text-only or treat certain bytes specially: SMTP email was designed for 7-bit ASCII, JSON cannot hold raw bytes, URLs reserve some characters, and HTTP headers are line-oriented text. Base64 carries binary safely through all of them. The mechanics: input bytes are grouped in threes (24 bits) and each group becomes four Base64 characters of 6 bits each, so output is always about 33% larger than input. This tool works on text. When encoding, it first converts your text to UTF-8 bytes (via encodeURIComponent) and then applies the browser's btoa, so emoji and non-Latin scripts survive correctly — something a naive btoa(text) call would crash on. Decoding reverses that with atob followed by a UTF-8 decode. It produces and accepts the standard alphabet with + and / only; it does not handle the URL-safe variant (- and _), and atob will reject input that contains those characters.

Common use cases

  • Encode a username:password pair to build an HTTP Authorization: Basic header value by hand.

  • Decode the header or payload segment of a JWT to read its JSON claims while debugging auth.

  • Encode a short UTF-8 string (including emoji or accented text) to paste into a JSON field or YAML config.

  • Decode a Base64 string from an API response, webhook, or log line to see the original text.

  • Wrap a small text snippet so it survives copy/paste through systems that mangle special characters.

  • Sanity-check that a Base64 value round-trips by encoding text, then decoding the result back.

Frequently asked questions

Is Base64 encryption?
No. Base64 is reversible encoding — anyone can decode it instantly with no key. For secrecy you need real encryption such as AES or RSA. Treating Base64 as a security measure is the single most common misconception about it.
Does this tool support URL-safe Base64?
No. It uses the standard alphabet with + and /. URL-safe Base64 (RFC 4648 section 5) swaps those for - and _, and the browser atob function this tool relies on will throw an error on - or _ characters. Convert URL-safe input back to + and / before decoding here, or use a dedicated URL-safe decoder.
Can I encode an image or other binary file?
Not directly — this tool takes text typed into a box, not file uploads. It encodes whatever characters you enter as UTF-8. To Base64 a real binary file you would read its bytes first, which this UI does not do.
Does it handle emoji and non-Latin text?
Yes. On encode it converts text to UTF-8 bytes before calling btoa, and on decode it runs a UTF-8 decode after atob. That avoids the classic JavaScript error where btoa() throws on characters outside Latin-1.
Why does Base64 make the output about 33% bigger?
Every 3 input bytes (24 bits) map to 4 output characters, since each Base64 character carries only 6 bits. That 4-for-3 ratio is inherent to the format and cannot be avoided.
Why do I see '=' signs at the end?
Those are padding. Base64 emits output in 4-character groups; when the input is not a multiple of 3 bytes, the final group is padded with one or two = signs so it still has 4 characters.
Is my data sent to a server?
No. Encoding and decoding run entirely in your browser using the built-in btoa and atob functions. Your text never leaves your device.

Related tools