Why use this encoder?
Transform binary into readable text and vice versa in one click.
Base64 allows you to transport data in text fields without breaking characters. Useful for embedding a small image in a data URL, putting a file in JSON, checking a MIME attachment, encoding a public key or decoding an HTTP header.
Base64 in a nutshell
Base64 is not encryption. It's encoding.
It takes bytes in groups of three and represents them with 64 symbols: A to Z, a to z, 0 to 9, plus + and /. The = sign serves as padding when the length is not a multiple of three. The result grows by about one third.
Advantage: the stream becomes safe for systems that only accept text.
Common variants
- Standard: alphabet + and /. This is the most common form.
- URL-safe: replaces + and / with - and _. The = padding can be omitted. Ideal in URLs and JSON.
- MIME: same rules as standard but with line breaks every 76 characters in emails.
How to use
- Paste the text to encode or the Base64 string to decode.
- Choose Encode to Base64 or Decode a Base64.
- Click Convert text then copy the result.
Tip
If you decode an image or PDF, you will see unreadable bytes. Save the content to a file with the correct extension.
Quick examples
HTTP Basic
String: user:pass → Base64: dXNlcjpwYXNz
Header: Authorization: Basic dXNlcjpwYXNz
Image data URL
data:image/png;base64,iVBORw0KGgo…
MIME attachment
Content-Transfer-Encoding: base64 followed by Base64 lines at 76 columns.
Troubleshooting and common errors
- No decoder: the string may be URL-safe. Convert - to + and _ to /.
- Missing padding: add = at the end until length is a multiple of 4.
- Unreadable text after decoding: the original input was not UTF-8 or you are looking at binary. Save to file.
- Double encoding: if you decode and still see Base64 characters, the data was encoded twice.
- Line breaks: MIME form tolerates breaks. Other parsers don't. Remove them before decoding.
Security and limits
- Base64 protects nothing. Do not put secrets in it without separate encryption.
- Size increases by about 33%. Avoid very large Base64 blobs in pages.
- Browsers limit the length of data URLs. Prefer a static file beyond a few dozen kb.
Recognizing a Base64 string
Standard: ^[A-Za-z0-9+/]+={0,2}$
URL-safe: ^[A-Za-z0-9\-_]+={0,2}$
These patterns help decide which variant to process.
Best practices
- Use UTF-8 for text before encoding.
- Prefix your data URLs with the correct media type.
- Avoid encoding private keys or secrets in a ticket or email.
- Keep a source copy if the content is critical.
Privacy commitment
Your input is sent to the CaptainDNS API only for encoding or decoding. The content is not stored. Only anonymous technical metrics are logged processing time and input size to ensure availability monitoring.