OnlyFormat

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text. Supports UTF-8 characters.

No data sent to server
Input
Output

Related Tools

What is Base64 Encoding?

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 commonly used to embed binary data in text-based formats such as JSON, XML, HTML, and email (MIME).

Base64 encoding increases the data size by approximately 33%, but ensures the data can be safely transmitted through text-only channels without corruption. Common use cases include encoding images as data URIs, transmitting file attachments in emails, and storing binary data in JSON APIs.

This tool handles UTF-8 text correctly, meaning you can encode and decode strings containing non-ASCII characters like emojis, Chinese, Japanese, Korean, and other Unicode characters without data loss.

How to Use

  1. Paste your plain text (to encode) or Base64 string (to decode) into the input box.
  2. Click "Encode" to convert text to Base64, or "Decode" to convert Base64 back to text.
  3. Copy the result with the Copy button or save it with Download.

Real-world use cases

  • HTTP Basic Auth: Authorization: Basic dXNlcjpwYXNz encodes user:pass
  • Data URLs: embed small images directly in HTML/CSS — data:image/png;base64,iVBO...
  • JWT tokens: three Base64URL-encoded sections joined with dots
  • Email attachments (MIME): binary files are Base64-encoded for 7-bit transport
  • JSON API binary: when you need to send binary data in a JSON field
  • Configuration secrets: some tools accept Base64-encoded values to avoid escaping issues (NOT for security)

Base64 vs Base64URL

Two characters in standard Base64 cause problems in URLs: + (URL-decoded as space) and / (path separator). Base64URL (RFC 4648 §5) replaces them with - and _ respectively, and often drops the trailing = padding. JWT tokens, OAuth state parameters, and API keys all use Base64URL specifically.

Spotting which is which: if you see +, /, or = at the end → standard Base64. If you see - or _ with no padding → Base64URL.

FAQ

Does it support Unicode and emojis?

Yes. This tool uses UTF-8 encoding internally, so characters like accented letters, CJK characters (Korean / Chinese / Japanese), and emojis are fully supported. Try encoding "한글 🎉" to see the result.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. It provides zero security — anyone can decode it. Never use Base64 to "hide" passwords, API keys, or sensitive data. Use proper encryption (AES) or hashing (Argon2, bcrypt) instead.

Why is the encoded output longer than the input?

Base64 maps every 3 bytes (24 bits) to 4 ASCII characters (32 bits, but only 24 useful), giving a 4/3 ratio — about 33% larger. Plus padding when the length isn't divisible by 3.

Why does decoding sometimes fail?

Most common reasons: (1) the input contains invalid characters (whitespace, line breaks not stripped), (2) padding = was dropped (try adding = until length is a multiple of 4), (3) it's actually Base64URL with -_ instead of +/ — replace those characters first, then decode.

Can I encode files (not just text)?

This tool handles text only. For files, drag your file to a free file-to-base64 utility, or use the command line: base64 myfile.png > encoded.txt on Mac/Linux, or PowerShell's [Convert]::ToBase64String on Windows.

What's the difference between Base64 and hex (Base16)?

Hex uses 2 chars per byte (100% overhead, very readable). Base64 uses ~1.33 chars per byte (33% overhead, less readable). Use hex for human-readable debug (SHA-256 fingerprints), Base64 for compact machine-to-machine transport.

⚠️ Reference Only

Output is generated based on your input and is provided for reference. Results may vary depending on your specific use case, edge cases, or environment-specific behavior. We do not guarantee accuracy of conversions, validations, or computed values.

Always verify critical outputs against official documentation or production environments. We are not responsible for any decisions or losses based on these tool results.