DevToolkit

Base64 Encode & Decode

Encode and decode Base64 strings instantly

Frequently Asked Questions

What is Base64 encoding?

Base64 is an encoding scheme that converts arbitrary binary data (images, files, etc.) into an ASCII string built from 64 printable characters (A–Z, a–z, 0–9, +, /). It lets binary content travel safely through text-only channels like email, JSON, URLs, and HTTP headers. Base64 is not encryption — anyone can decode it back to the original bytes.

What can I do with a Base64 encoder/decoder?

Common scenarios include embedding images as Data URLs in HTML/CSS, generating Basic Auth credentials, transmitting strings that contain special characters, inspecting email attachments, and debugging the payload section of JWTs. In the decode direction, you can recover Base64 strings that appear in API responses or logs.

What inputs are supported? Can I encode files?

You can paste plain text for either direction. Non-ASCII characters such as CJK or emoji are UTF-8 encoded before Base64 conversion — no extra configuration needed. You can also upload binary files (images, PDFs) and get a Base64 string back, all without leaving the browser.

Why do I get "Invalid base64 string" or garbled output when decoding?

Typical causes: stray whitespace or newlines, a truncated string, URL-safe Base64 (containing - and _) decoded with the standard alphabet, or missing = padding. Strip whitespace, verify length is a multiple of 4, and switch to the URL-safe option if the string came from a URL. Garbled output usually means the original bytes were not UTF-8 text (e.g., raw PNG data).

Is my data uploaded anywhere?

No. Encoding and decoding happen entirely in your browser, so credentials, tokens, and internal API payloads never leave your device.

How is Base64 different from URL encoding?

URL (percent) encoding only escapes characters that are illegal or reserved in URLs — the rest of the string stays intact. Base64 re-encodes everything using 64 characters and can represent any binary data. Use URL encoding for query parameters and path segments; use Base64 when you need to embed binary content in a text field. For Base64 strings that live inside URLs, prefer the URL-safe variant.

Related Tools