Skip to content
toolzom

Base64 Encoder & Decoder

Convert text and files to Base64 and back. Works with accents and emoji, URL-safe Base64 and data URLs, and everything is processed on your device.

Uses - and _ instead of + and /, without = padding, so it can go in URLs and file names.

How to encode or decode Base64

  1. Choose Encode to turn text or a file into Base64, or Decode to turn Base64 back into the original data.

  2. Type or paste your content. The result updates as you type; to encode an image or a document, use Encode a file.

  3. Copy the result, or download it if the decoded data is a file. Use Use result as input to reverse the conversion and check it.

Where Base64 is used

Embedding images

A small icon can be inlined in HTML or CSS as a data URL (data:image/png;base64,…) to save a request.

APIs and JSON

JSON can't carry raw bytes, so APIs often send files, signatures or keys as Base64 strings.

Email attachments

MIME encodes attachments as Base64 so binary files survive systems designed only for text.

Tokens and URLs

JSON Web Tokens and many signed URLs use URL-safe Base64, which avoids characters with a special meaning in URLs.

How Base64 works

Base64 represents any data using 64 safe characters: A–Z, a–z, 0–9, + and /. Every 3 bytes of input become 4 characters of output, so encoded data is about 33% larger than the original. When the input length isn't a multiple of 3, one or two = signs are added as padding.

Text is first converted to bytes with UTF-8, the encoding used on the web, so letters such as ñ or é and emoji are encoded correctly. When decoding, the tool accepts both alphabets (standard and URL-safe), missing padding and line breaks, and detects whether the result is text or binary data such as an image.

Base64 is an encoding, not encryption: anyone can decode it, so it doesn't protect information. Everything here happens in your browser; nothing you paste or open is uploaded or stored.

Frequently asked questions

Is Base64 a form of encryption?

No. Base64 only changes how data is represented, and anyone can decode it without a key. To protect information you need real encryption.

Why is the Base64 result larger than the original?

Base64 uses 4 characters for every 3 bytes, so the output is about a third larger. That's the price of using only text-safe characters.

What is URL-safe Base64?

A variant that uses - and _ instead of + and /, usually without = padding. It can go in URLs and file names without escaping, and it's used by JSON Web Tokens.

Why does my decoded text show strange characters?

The original may not have been UTF-8 text. If the decoded data is binary, such as an image, the tool offers it as a download instead of showing it as text.

Are my files uploaded?

No. Files are read and encoded in your browser and never leave your device. Files up to 5 MB are supported.