Emergency server help: get in touch

Base64 Encoder and Decoder

Convert text and files to and from Base64, including URL-safe Base64 and data URIs.

Where it runs
Runs in your browser
Last updated
October 9, 2026

Use this Base64 encoder and decoder to encode text to Base64 or decode Base64 back to readable text, with correct UTF-8 handling for accents and emoji. Options cover the URL-safe alphabet and 76-character MIME lines. You can also turn a file into Base64 or a data URI, and save decoded Base64 as a file. Everything happens in your browser; files are never uploaded.

Loading the tool… It runs in your browser and needs JavaScript.

How to use it

Choose a direction and type or paste into the box; the result updates as you type. Swap moves the result into the input and flips the direction, which is a quick way to check a round trip. The file section reads a file of up to 5 MB from your device and shows its Base64, optionally as a data: URI with the file’s type. The last section takes Base64 or a data URI and downloads the decoded bytes as a file.

What the options mean

  • UTF-8: text is turned into UTF-8 bytes before encoding, so é becomes two bytes and most emoji four. Decoding expects UTF-8 too.
  • URL-safe: RFC 4648 section 5 replaces + with - and / with _; padding is dropped. JWTs and many APIs use this form. The decoder accepts both alphabets, with or without padding.
  • Wrap at 76: MIME email bodies (RFC 2045) break Base64 into lines of at most 76 characters. Most other uses want a single line.
  • Data URI: prefixes the result with data:image/png;base64, or the file’s own type, ready for HTML or CSS.

Common errors

The decoder tells you what is wrong. A character outside the Base64 alphabet, such as a stray quote or $, is reported with its position. A length that leaves one character over usually means something was cut off when copying. Padding (=) in the middle means two strings were joined together. If the bytes decode but are not valid UTF-8, the data is probably binary, such as an image or a gzip file: use Download decoded bytes instead.

For server admins

The same conversions on the command line with coreutils and OpenSSL:

echo -n 'user:password' | base64          # encode, no trailing newline
echo 'dXNlcjpwYXNzd29yZA==' | base64 -d   # decode
base64 -w 0 backup.tar.gz > backup.b64    # one long line
openssl base64 -A -in cert.der            # OpenSSL, single line

When a decoded value looks wrong, check whether the source used the URL-safe alphabet or had line breaks added by a mail client; this tool accepts both, but some command-line decoders do not.

Remember that Base64 is an encoding, not encryption. HTTP Basic credentials or Kubernetes secrets in Base64 can be read by anyone who sees them.

Base64 Encoder at a glance

Base64 Encoder – short answer
In short: Convert text and files to and from Base64, including URL-safe Base64 and data URIs.
Base64 Encoder – what this tool covers
Base64 Encoder: what this tool covers.
Base64 Encoder – questions answered
Base64 Encoder: the questions this tool answers.

Related tools: URL Encoder, Decoder and Parser · JWT Decoder and Verifier · Hash Generator (MD5, SHA-1, SHA-256, SHA-512) · Binary Translator: Text to Binary and Back.

Official documentation (checked 9 October 2026): RFC 4648: The Base16, Base32, and Base64 Data Encodings · MDN: TextEncoder

Frequently asked questions

Is Base64 encryption?

No. Base64 only changes how bytes are written so they survive text-only channels. Anyone can decode it, so never treat it as a way to hide passwords.

Why is my Base64 output longer than the input?

Base64 writes every 3 bytes as 4 characters, so output is about a third larger, plus line breaks if you wrap at 76 characters.

What is the difference between Base64 and Base64URL?

Base64URL uses – and _ instead of + and / so the result is safe in URLs and file names, and it usually leaves out the = padding.

Share this tool

Free website test

Is your website set up right?

Check SSL, security headers, redirects, robots.txt, sitemap, llms.txt and security.txt in one test. It takes about 30 seconds.