Skip to content
FlipConverto home

Base64 Encoder & Decoder

A Base64 encoder and Base64 decoder: encode text, or decode Base64 to text, with correct handling of Unicode and emoji.

Loading Base64 Encoder & Decoder…

Runs entirely in your browser. What you enter stays on your device — nothing is sent to a server. Verify it yourself

Is Base64 encryption?

No. Base64 is a reversible encoding with no key and no secret — anyone can decode it instantly, and it provides no confidentiality whatsoever. Its purpose is carrying binary data through channels that only handle text safely.

Cost
Free, no limits
Upload
None — runs on your device
Sign-up
Not required
Works offline
Yes, once loaded

How to encode or decode Base64

  1. Choose encode or decode

    The buttons at the top switch direction.

  2. Enter the text

    Type or paste the text to encode — any language or emoji, because it is encoded as UTF-8 — or the Base64 to decode.

  3. Pick the alphabet

    Tick URL-safe alphabet for Base64 that goes into a URL: it uses - and _ instead of + and /, and drops the padding.

  4. Copy the result

    Use the Copy button under the output.

Examples

  • Hello, world!SGVsbG8sIHdvcmxkIQ==

    The trailing = characters are padding, not part of the data.

  • SGVsbG8=Hello

    Decoding is the same operation in reverse — no key involved.

Key features of the Base64 Encoder & Decoder

  • Encodes text to Base64 and decodes it back
  • Handles Unicode correctly via UTF-8
  • Immediate results as you type
  • Runs locally — nothing is transmitted

Supported formats

Modes

  • Encode
  • Decode

Alphabets

  • Standard (+ /)
  • URL-safe (- _)

Text

  • UTF-8, emoji included

When should you use this?

  • Reading the payload of a JWT or an API header.
  • Embedding a small asset in a data URI.
  • Moving binary-ish data through a text-only channel.
  • Debugging a value that arrived Base64-encoded.

Limitations

  • Base64 is an encoding, not encryption. Anyone can decode it instantly — it protects nothing, and using it for secrets is a security mistake rather than a weak defence.
  • Encoded output is about 33% larger than the input. That is inherent: four output characters for every three input bytes.
  • Standard Base64 uses + and / , which have meaning in URLs. A URL-safe variant substitutes - and _ ; a value from one is not valid in the other.
  • This tool works on text. Encoding an arbitrary binary file needs a file-based encoder.

Troubleshooting

Decoding produces garbled characters

The input was probably not UTF-8 text, or it is the URL-safe variant. Try replacing - with + and _ with / before decoding.

It refuses to decode

Base64 length must be a multiple of four once padding is accounted for. A truncated or partially copied string will fail.

Common mistakes to avoid

  • Treating Base64 as a security measure. It is a transport encoding and offers no confidentiality whatsoever.
  • Encoding a large file into a data URI. The 33% overhead plus the loss of caching usually makes this worse than a separate request.

Pro tips

Tips for better results

  • JWTs

    Nonsense output usually means the URL-safe variant

    If a decoded JWT payload looks like nonsense, check whether it is the URL-safe variant — swapping - for + and _ for / usually fixes it.

  • Padding

    Missing = padding is common and usually tolerated

    Padding with = is required by the strict specification but omitted by some producers. Most decoders tolerate its absence.

Standards and terms behind the Base64 Encoder & Decoder

The named things this tool works with, and the documents that define them.

Base64 (RFC 4648)Specification
The IETF encoding that carries arbitrary bytes as 64 printable characters, so binary survives text-only channels. Reference: Base64 (RFC 4648)
Data URIHow it works
A whole file embedded in a URL as Base64, which saves a request and costs about a third more bytes.
Unicode and UTF-8Specification
The character set and encoding that let one text file hold every writing system.
IETFWho made it
The body that publishes RFCs, including those defining WebP, FLAC, Opus, Matroska and JSON.

Also searched as: decode a base64 string, encode a file as base64, base64 image data uri.

Why Unicode breaks naive Base64 tools

JavaScript's built-in btoa operates on Latin-1 and throws on any character above U+00FF. That means the obvious implementation of a Base64 tool fails on the first accented letter, Cyrillic character, CJK character or emoji it meets.

The fix is to encode the text to UTF-8 bytes first and Base64 those bytes. That is what this tool does, which is why "café 👋" round-trips correctly here and errors on many other converters.

Base64 is encoding, not encryption

This is worth stating plainly because the mistake is common and consequential. Base64 is a reversible representation with no key and no secret — anyone can decode it instantly. It provides no confidentiality whatsoever. Its purpose is to carry binary data through channels that only handle text safely.

URL-safe Base64

Standard Base64 uses + and /, both of which have meaning in a URL, and = padding, which can be mangled. The URL-safe variant substitutes - and _ and drops the padding. JSON Web Tokens use this variant, which is why a JWT segment pasted into a standard decoder often fails. The decoder here accepts both.

Size cost

Base64 encodes three bytes as four characters, so encoded data is about 33% larger than the original. That is the trade for text-safety, and it is why embedding large images as data URIs makes pages heavier than linking to the file.

Privacy

The Base64 Encoder & Decoder runs entirely in your browser. What you enter and the result it produces stay on your own device — nothing is sent anywhere, because nothing needs to be.

You can confirm this rather than take our word for it: open your browser’s developer tools, watch the Network tab, and use the tool. No request carries your input. It also keeps working with the connection off.

Details are in the privacy policy.

What next?

For escaping characters in a query string, which is a different job.

URL encoding instead

Base64 Encoder & Decoder — questions

Is Base64 encryption?

No. It is a reversible encoding with no key and no secret — anyone can decode it in seconds. It provides no security at all. Use it to carry binary data through text channels, never to protect anything.

Why do other Base64 tools fail on emoji and accented characters?

Because JavaScript's btoa only handles Latin-1 and throws on anything above U+00FF. This tool encodes to UTF-8 bytes first, so Unicode round-trips correctly.

What is URL-safe Base64?

A variant that uses - and _ instead of + and /, and omits the = padding, so the result is safe in a URL. JSON Web Tokens use it. The decoder above accepts both alphabets automatically.

How much larger does Base64 make data?

About 33% — every three bytes become four characters. That is why embedding images as data URIs makes a page noticeably heavier than linking to the image file.

Part of Developer Tools · Browse every tool