🔐
Base64 Encoder / Decoder
Text or files · URL-safe detected automatically · decode to a downloadable file
Ctrl+Enter = encode
Result appears here

Base64 Encoder & Decoder

Free online Base64 encoder and decoder. Encode text or any file to Base64, or decode Base64 and data URLs back to text — or to a downloadable file when the data is an image, PDF or ZIP. URL-safe Base64 and missing padding are handled automatically. 100% client-side — nothing is sent to any server.

Free No login 100% browser-based Your input never leaves your device

Try these next

What is a Base64 Encoder?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is one of the most widely used encodings on the web — every JWT token is Base64-encoded, email attachments travel as Base64, and data URIs embed images as Base64 strings.

This tool encodes text or files, and decodes Base64 back to text or a file, entirely in your browser. Nothing is sent to any server. It supports standard Base64, MIME line breaks, data URLs and URL-safe Base64 (which replaces + with - and / with _ for safe use in URLs and filenames).

How to encode and decode Base64

1. Select Encode or Decode mode using the tabs. 2. Paste text, or click Encode a file (or drop a file on the box). 3. The output updates automatically. 4. Click Copy, or Download file after decoding. For URL-safe Base64 (used in JWTs), turn on URL-safe: the output uses - instead of + and _ instead of /.

When to use Base64

Use Base64 when you need to transmit binary data (images, files) through a text-only channel like JSON, HTML attributes, CSS, or email. Avoid it for large files — the 33% size increase is significant. For images specifically, use the Image to Base64 tool which handles file uploads directly.

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that converts binary data into ASCII characters. It uses 64 printable characters (A–Z, a–z, 0–9, +, /) and is widely used in email, JWTs, and embedding binary data in JSON or HTML.
Is Base64 a form of encryption?
No. Base64 is encoding, not encryption. It provides no security — anyone can decode it instantly. For security, use proper encryption like AES.
Why does my Base64 string end in = or ==?
The = characters are padding. Base64 encodes 3 bytes into 4 characters. When the input isn't a multiple of 3 bytes, = padding characters are added to complete the group.
What is Base64 URL encoding?
Base64 URL encoding is a variant of standard Base64 that replaces + with - and / with _, making the output safe for URLs and filenames without percent-encoding. JWTs use Base64url. The padding character = is often omitted. Always check which variant an API expects.
Why is Base64 used in JWTs?
JWT (JSON Web Token) header and payload are Base64url-encoded so they can be safely transmitted in HTTP headers and URLs without special character issues. The signature is also Base64url-encoded. Base64url is chosen over regular Base64 because + and / have special meaning in URLs.
How do I decode Base64 in different languages?
Python: base64.b64decode(s). JavaScript: atob(s) for browser, Buffer.from(s, "base64") for Node.js. PHP: base64_decode($s). Java: Base64.getDecoder().decode(s). Go: base64.StdEncoding.DecodeString(s). All standard libraries have built-in Base64 support.
Does Base64 work for binary files like images?
Yes. Drop any file (up to 25 MB) on this tool, or use Open file, and it encodes the file's exact bytes; decoding gives you a download of the original file. Base64 makes data about 33% larger (every 3 bytes become 4 characters), so only embed binary data this way when you need to, such as email attachments or small CSS data URIs. For images, the Image to Base64 tool gives you a ready-made data URL.
✓ Copied!