Base64

Base64 Encoder/Decoder Tool

Base64 Encoder/Decoder Tool

Encode text to Base64 and decode Base64 back to text. Supports various options for encoding and decoding.

Input

Enter text to encode or Base64 to decode...

Result

Encoded/Decoded text

Examples

Hello, World! SGVsbG8sIFdvcmxkIQ==
Base64 is awesome! QmFzZTY0IGlzIGF3ZXNvbWUh
URL-safe example VVJMLXNhZmUgZXhhbXBsZQ

About Base64

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It's commonly used to encode binary data for transmission over text-based protocols.

  • Uses 64 characters (A-Z, a-z, 0-9, +, /)
  • URL-safe variant uses - and _ instead of + and /
  • Padding with = to make length divisible by 4
  • Increases size by approximately 33%
Common Uses
  • Email attachments (MIME)
  • Data URLs in web pages
  • Basic authentication headers
  • Storing binary data in text files
  • API responses with binary content
Limitations
  • Not suitable for encryption
  • Increases data size
  • May contain special characters
  • URL-safe variant needed for web use
  • Padding characters may cause issues
JavaScript Implementation

Base64 encoding/decoding in JavaScript:

  • btoa() - Encode string to Base64
  • atob() - Decode Base64 to string
  • Buffer.from() - Node.js Buffer for binary data
  • TextEncoder/TextDecoder - Handle Unicode
Security Considerations
  • Not for sensitive data storage
  • Can be easily decoded
  • May expose binary data structure
  • Use proper encryption for secrets
  • Validate decoded data
Best Practices
  • Use URL-safe encoding for web
  • Handle padding correctly
  • Validate input data
  • Consider data size impact
  • Use appropriate character encoding