idcd

Base64 Encoder / Decoder

Base64 is a binary-to-text encoding that represents binary data using 64 printable ASCII characters.

Input

Output

Usage

• Text: convert between UTF-8 text and Base64, with URL-safe or per-line batch options

• File / Image: drag or select a file to encode as Base64 / Data URL, ready to paste into CSS or img src

• URL-safe: uses - _ instead of + / and strips trailing = padding, suitable for URLs or JWT

• All encoding / decoding runs locally in your browser; files are never uploaded

Related tools

What Base64 encoding and decoding is for

Base64 is a binary-to-text encoding that represents binary data using 64 printable ASCII characters. The encoder takes UTF-8 text or a binary file and produces a Base64 string; the decoder reverses the process. The URL-safe variant substitutes + with - and / with _ and strips padding, making the output safe for use in URLs, HTTP headers, and JSON without further escaping.

Common uses include encoding binary files for embedding in HTML (data: URLs), transporting binary data in JSON payloads or HTTP headers that only accept text, encoding credentials in HTTP Basic Authentication, and inspecting or creating JWT tokens (which use URL-safe Base64 for their header and payload).

Frequently asked questions

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It is fully reversible by anyone with the encoded string and provides no confidentiality. Do not use Base64 to protect sensitive data.

What is the difference between standard and URL-safe Base64?

Base64url replaces + and / with - and _. Whether = padding is omitted depends on the enclosing protocol; JWT uses an unpadded form. Padding omission is not universal to every Base64url use.

Why is the encoded file larger than the original?

Base64 encodes every 3 bytes of input into 4 ASCII characters, which is approximately a 33% size increase. This is an inherent property of the encoding.

Can I encode and decode files?

Yes. Use the File / Image tab to drag or select any file for encoding to a Base64 string or Data URL. For decoding back to a file, paste the Base64 string in the text tab and use the download button.

References and result limitations

Local results depend on the input and selected options. Retain the input example, format and processing rules when citing a result, and verify the output. Keep keys and other sensitive material out of public examples.

These references explain protocol or format rules; they do not endorse results produced by this site.