Base64 Encoder / Decoder

Encode / decode Base64 for text, files and images with URL-safe variant — all in your browser

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?

Standard Base64 uses + and / characters and = padding. URL-safe Base64 replaces + with - and / with _, and optionally removes = padding. Use URL-safe Base64 when the encoded string will appear in a URL, cookie, or JWT.

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.