Free developer tool

Base64 Encoder and Decoder

Encode and decode Base64 for text and files, UTF-8 safe, with URL-safe and data URI options.

Base64 for text and files

Base64 turns any data into plain ASCII letters, digits and + / characters so it can travel through systems built for text: data URIs in CSS and HTML, email attachments, JSON payloads and HTTP headers. Encoded data is about a third larger than the original.

Text is converted to UTF-8 first, so accented letters, non-Latin scripts and emoji round-trip correctly. That's the common pitfall with the browser's built-in btoa(), which fails on anything outside Latin-1.

Options

  • URL-safe uses - and _ instead of + and / and drops = padding (RFC 4648 §5), for URLs, file names and JWTs.
  • Data URI wraps a file as data:type;base64,…, ready to paste into CSS or an <img> tag.
  • Decoding accepts both alphabets, missing padding, line breaks and full data URIs. Binary results can be downloaded as a file.

Frequently asked questions

Is Base64 encryption?
No. Base64 is an encoding that anyone can reverse instantly. Never use it to hide passwords or secrets.
Should I inline images as Base64 data URIs?
Only very small ones, like tiny icons. Base64 makes files about 33% bigger and inlined images can't be cached separately, which usually slows pages down.
Are my files uploaded?
No. Encoding and decoding happen in your browser and nothing is sent to a server.