Base64 Encode

Convert text to Base64 for use in data URIs, HTTP headers, JSON payloads or email, with URL-safe and MIME-wrapped variants.

  • Runs in your browser
  • Free, no sign-up
Ctrl + Enter also runs the tool

What this tool gives you

Correct UTF-8 handling

Accents and emoji are encoded as UTF-8 bytes, matching what servers expect.

Base64url option

The alphabet used by JWTs, URL parameters and file names.

MIME wrapping

Insert line breaks every 76 characters for email bodies and certificates.

Frequently asked questions

How much bigger is the output?

Base64 produces four characters for every three bytes, so the encoded text is about 33 percent larger than the UTF-8 input, plus padding.

When should I use Base64url?

Whenever the value travels inside a URL or a file name. The standard alphabet contains + and / which have special meaning there.

Can I encode a file?

Not with this page, which works on text. Use a terminal command such as base64 file.png, or a data-URI generator, for binary files.

Why does the output end with = signs?

Padding marks an input length that is not a multiple of three bytes. Many decoders accept missing padding, which is why the no-padding option exists.

From APIVoid

Need security checks inside your own product?

APIVoid turns the lookups you run here into developer-friendly JSON APIs: IP reputation, URL status and redirects, DNS lookups, SSL info, domain age, screenshots and much more. Simple pricing, 30-day free trial.