Base64 Encoder and Decoder

Encode text to Base64 and decode Base64 back to text, with full support for accents, emoji and URL-safe Base64.

Usage examples — click to load:

Encode and decode text with Base64 for free. Turn text into Base64 or convert encoded content back into readable text, in real time as you type. Base64 represents any sequence of bytes using just 64 safe characters (letters, digits, + and /), so data can travel through channels that only accept text — JSON, HTTP headers, email and URLs. It's ideal for developers and anyone working with APIs, system integrations and data handling.

The converter treats text as UTF-8, so accents and emoji survive the round trip instead of turning into garbled characters — a common problem when calling btoa() directly in JavaScript. When decoding, it accepts both standard Base64 and the URL-safe variant (Base64URL, used in JWT tokens), ignores spaces and line breaks, and tells you clearly when the content is invalid or represents a binary file rather than text. Everything happens in your browser: nothing you paste is sent to a server.

How to use

  1. Choose a direction: "Encode" to turn text into Base64 or "Decode" for the reverse.
  2. Type or paste your content in the left-hand field — the result appears instantly on the right.
  3. Copy the result, use "Swap" to send the output back as input, or "Clear" to start over.

Where Base64 shows up day to day

  • HTTP Basic authentication: the Authorization header carries "user:password" encoded in Base64.
  • JWT tokens: the header and payload are JSON encoded as Base64URL — you can decode them here to inspect their contents.
  • Data URIs: small images and fonts embedded straight into HTML or CSS (data:image/png;base64,...).
  • APIs and integrations that carry attachments, certificates or keys inside JSON or XML fields.

Practical example

The phrase "Olá, mundo!" (Portuguese for "Hello, world!") becomes T2zDoSwgbXVuZG8h in Base64. Note that "á" takes two bytes in UTF-8 (C3 A1), which is why the result is slightly longer than it would be for plain ASCII. To build a Basic authentication header, encode user:password123 and you get dXNlcjpwYXNzd29yZDEyMw==; the final header reads Authorization: Basic dXNlcjpwYXNzd29yZDEyMw==.

Frequently asked questions

Is Base64 encryption?

No. Base64 is just an encoding: anyone can reverse it without any key, exactly as this tool does. Never use Base64 to hide passwords or sensitive data — that's what encryption and hashing algorithms are for.

Why is the Base64 text longer than the original?

Because every 3 bytes are represented by 4 characters. In practice the result is about 33% larger than the original, and the trailing = signs are only padding to complete the last group.

What's the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and /, which have special meaning in URLs. The URL-safe variant (Base64URL) replaces them with - and _ and usually drops the = padding. It's used in JWT tokens and link parameters. This converter decodes both variants automatically.

Why do I get an error saying the content isn't text?

That happens when the Base64 is valid but the decoded bytes don't form UTF-8 text — usually because they represent an image, a PDF or another binary file. This converter is built for text; showing those bytes as letters would only produce meaningless characters.

Do accents and emoji work?

Yes. Text is turned into UTF-8 bytes before encoding, and decoding does the reverse. Words like "café" and "naïve" or emoji like 🚀 come back exactly the same, even if the Base64 was produced by another language that also uses UTF-8.

Is the data I paste here stored anywhere?

No. The conversion runs entirely in your browser with JavaScript, and nothing is sent to or stored on a server. When you close or reload the page, the fields are cleared.