Skip to content
everylittletool

Base64 Encode & Decode

Encode and decode Base64 text, or turn any file into a data URL.

Runs in your browser — nothing is uploaded

Base64

SGVsbG8sIHdvcmxkISDinJM=

How to use Base64 Encode & Decode

  1. 1

    Choose Text to convert a string, or File → Base64 to convert a file.

  2. 2

    For text, choose Encode or Decode and type or paste into the box; the result updates as you type. Tick URL-safe for Base64URL output.

  3. 3

    For a file, select Choose a file or drop it on the page.

  4. 4

    Select Copy, Copy Base64 only or Copy data URL to take the result.

About this tool

Base64 represents any bytes using 64 safe characters (A–Z, a–z, 0–9, + and /), so binary data can travel through systems built for text, such as email, JSON and HTML. Every three bytes become four characters, so encoded data is about 33% larger than the original. Base64 is an encoding, not encryption: anyone can decode it.

Text is converted to UTF-8 bytes before encoding, so accents, non-Latin scripts and emoji round-trip correctly. A plain btoa() call in JavaScript fails on those characters. When decoding, the tool accepts both standard and URL-safe Base64, with or without = padding, ignores line breaks and strips a leading data: prefix. If the bytes are not valid UTF-8 text, for example because the Base64 holds an image, it tells you so instead of showing garbage.

URL-safe Base64 (Base64URL, from RFC 4648) replaces + with - and / with _ and drops the padding, so the result can sit in a URL or file name without escaping. It is the variant used inside JWTs.

File → Base64 produces a data URL such as data:image/png;base64,…, which you can paste straight into CSS or an img tag. That suits small icons; for large files a normal link is better, because the encoded text is a third bigger and cannot be cached separately. Files are read locally and never uploaded.

Questions people ask

Is Base64 encryption?

No. Base64 is a reversible encoding that anyone can decode. Never use it to hide passwords or secrets.

Why does my decoded Base64 look like gibberish?

The data is probably binary, such as an image, PDF or compressed file, rather than text. The tool warns you when the decoded bytes are not valid UTF-8.

What is the difference between Base64 and Base64URL?

Base64URL uses - and _ instead of + and /, and usually omits = padding, so it is safe in URLs and file names.

How much bigger does Base64 make a file?

About 33% bigger, because every 3 bytes are written as 4 characters.

How do I convert an image to Base64?

Choose File → Base64, pick the image, then select Copy data URL. You can use it as an img src or a CSS background.