Base64 Encoder and Decoder

Encode and decode Base64 with correct UTF-8 handling, URL-safe output, and file to data URI conversion.

  • Runs in your browser
  • Free, no sign-up
What do you want to do?
Direction

26 B as UTF-8

Base64

Runs entirely in your browser. Nothing you enter is sent to our server.

How to use the base64 encoder and decoder

  1. Choose Text, File to Base64, or Base64 to file.
  2. For text, pick Encode or Decode and type or paste. Turn on URL-safe to use - and _ instead of + and /.
  3. For files, choose a file up to 10 MB and copy the Base64 string or data: URI.
  4. To rebuild a file, paste Base64 or a data: URI. The type is detected and you can download the file.

Worked example

Non-ASCII text

Grüße encodes to R3LDvMOfZQ==, because ü and ß each take two bytes in UTF-8. Hello, world! encodes to SGVsbG8sIHdvcmxkIQ==. Decoding abc$ fails with an invalid character error at position 4.

How it works

Text is converted to UTF-8 bytes with TextEncoder, then to Base64 (RFC 4648). URL-safe output replaces + and / with - and _ and can omit padding. Decoding accepts both alphabets, ignores whitespace and a data: prefix, validates characters, padding and length, then decodes the bytes with a strict UTF-8 decoder so binary data is reported rather than shown as garbled text.

Frequently asked questions

Is my data uploaded?

No. This tool runs entirely in your browser. Your input is processed on your device and is not sent to our server or stored.

Is Base64 encryption?

No. Base64 is an encoding that anyone can reverse. Do not use it to hide passwords or secrets.

Why does decoding say the result is not valid UTF-8?

The Base64 contains binary data such as an image or a zip file, not text. Use the "Base64 to file" option to download it instead.

What is URL-safe Base64?

A variant (base64url) that uses - and _ instead of + and /, so the result can go in URLs and file names without escaping. JSON Web Tokens use it without padding.

Limitations

  • Files are limited to 10 MB because the Base64 text is about 33% larger than the file and is held in memory.
  • Very long outputs are available through Copy and Download rather than shown on screen.