Free online tools to generate, calculate,
convert, format, encode, and play.
 

Base64 Encoder/Decoder

Encode and decode text or files using Base64, URL-safe Base64, or Base32. Includes hex view for binary inspection.


Mode

Format

Text Input

File Upload

Drop a file here or click to browse

CLI Quick Reference

echo -n "text" | base64
base64 < file.bin
echo "SGVsbG8=" | base64 -d
base64 -d < encoded.txt > file.bin

How It Works

Base64 (RFC 4648)

Base64 encodes binary data into ASCII text using 64 characters: A-Z, a-z, 0-9, +, /. Every 3 input bytes become 4 output characters, resulting in ~33% size increase. Padding = is added when input length isn't a multiple of 3.

URL-Safe Base64

Replaces + with - and / with _, making the output safe for URLs, filenames, and query parameters without percent-encoding.

Base32 (RFC 4648)

Uses 32 characters: A-Z and 2-7. Every 5 input bytes become 8 output characters (~60% overhead). Case-insensitive and avoids confusing characters (0/O, 1/I), making it suitable for human-readable tokens and TOTP secrets.

Common Uses
  • Email: MIME attachments
  • Data URIs: Embed images in HTML/CSS
  • JWT: Token payload encoding
  • APIs: Binary data in JSON
  • SSH keys: Key file encoding
  • Authentication: Basic Auth headers
Size Comparison
  • Base64: 33% overhead (3 bytes → 4 chars)
  • Base32: 60% overhead (5 bytes → 8 chars)
  • Hex: 100% overhead (1 byte → 2 chars)
Alphabet

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

Example: "Hello" → "SGVsbG8="

Note: Encoding is not encryption. Base64/Base32 provide no security — anyone can decode the data. Use proper encryption for sensitive information.


Feedback

Help us improve this page by providing feedback, and include your name/email if you want us to reach back. Thank you in advance.


Share with