πŸ› οΈ Developer Tools
Β· 1 min read

Free Base64 Encoder / Decoder


Encode or decode Base64 strings. Everything runs in your browser.

When Do You Need Base64?

  • Embedding images in CSS/HTML: data:image/png;base64,...
  • Sending binary data in JSON: APIs that don’t support binary
  • Email attachments: MIME encoding
  • Basic auth headers: Authorization: Basic base64(user:pass)

Code Examples

// JavaScript
btoa('Hello')           // "SGVsbG8="
atob('SGVsbG8=')        // "Hello"
# Python
import base64
base64.b64encode(b'Hello')  # b'SGVsbG8='
base64.b64decode(b'SGVsbG8=')  # b'Hello'
# Bash
echo -n 'Hello' | base64     # SGVsbG8=
echo 'SGVsbG8=' | base64 -d  # Hello

Related: Free HTML Entity Encoder & Decoder