Free Online Base64 Encoder & Decoder
Base64 is a binary-to-text encoding scheme that represents binary data in an ASCII string format. It is commonly used to embed images, fonts, and files directly in HTML, CSS, and JSON without needing separate HTTP requests.
When to Use Base64 Encoding
- Embedding small images directly in CSS as
background: url('data:image/png;base64,...')
- Sending binary data in JSON APIs or form fields
- Encoding credentials for HTTP Basic Authentication headers
- Storing binary data in environments that only support text (XML, JSON)
URL-Safe Base64
Standard Base64 uses + and / which are special characters in URLs. URL-safe Base64 replaces these with - and _ and strips the = padding, making it safe to use in query strings and URL fragments.