Base64 Encoder & Decoder
100% Client-Side • Local Browser Processing100% Client-Side Processing
All encoding and decoding uses native btoa/atob and TextEncoder/TextDecoder APIs. Your data never leaves your browser.
URL-Safe Base64 (RFC 4648)
Toggle URL-safe mode to replace + with -, / with _, and strip padding. Safe for use in URLs and HTTP headers.
File to Data URI
Upload any file to instantly generate a Base64-encoded Data URI, ready for embedding in HTML, CSS, or API payloads.
Standard Base64 vs URL-Safe Base64 (RFC 4648)
Base64 encodes binary data into 64 printable ASCII characters. Standard vs URL-safe encoding differences:
| Variant | 62nd & 63rd Chars | Padding (=) | Primary Use Case |
|---|---|---|---|
| Standard (RFC 4648 §4) | + and / | Strict (1 or 2 =) | MIME email attachments, HTTP Basic Auth, Data URIs |
| URL-Safe (RFC 4648 §5) | - and _ | Optional / Omitted | JWT headers & payloads, URL query parameters, filenames |
File to Data URI Scheme Format
Data URIs allow embedding image, audio, and font files directly into HTML or CSS without separate HTTP network roundtrips:
data:[<mediatype>][;base64],<encoded_data>Example: data:image/png;base64,iVBORw0KGgoAAAANSUhEUg...
URL-safe Base64 is also the encoding format used by JSON Web Tokens (JWT) for both the header and payload segments. Learn how to debug invalid JWT claim errors.
How Base64 Encoding Works
Base64 encoding translates binary data into a set of 64 ASCII characters. Here is how the process works in your browser:
- Input Parsing: Plaintext or uploaded files are read into an ArrayBuffer or UTF-8 byte stream using TextEncoder.
- Bit Chunking: Data bytes are grouped into 24-bit blocks and divided into four 6-bit index numbers.
- Character Lookup: Each 6-bit index maps directly to a character in the RFC 4648 Base64 alphabet.
- Padding & Output: Trailing '=' characters are appended as necessary to align 24-bit boundaries.
Client-Side Base64 Security
Encoding sensitive credentials or certificates with cloud utilities risks data leakage. Local processing ensures full safety:
Zero Server Transmission: TextEncoder and Web APIs handle all conversions locally on your machine.
URL-Safe Standard Support: Encode tokens for web headers safely without exposing payload values to remote proxies.
Frequently Asked Questions
Related Developer Utilities
Explore complementary 100% client-side tools to accelerate your development workflow.
JWT Decoder & Inspector
Decode token headers, payload claims, and verify expiry timestamps safely.
Cryptographic Hash Generator
Compute SHA-256, SHA-512, SHA-1, and MD5 checksums for strings and files.
JSON Formatter & Validator
Format, validate, beautify, and auto-repair JSON payloads locally in browser.
cURL to Code Converter
Convert cURL commands to Python Requests, JavaScript Fetch, Axios, PHP, and Go.
Built for Daily Developer Workflows
Free, browser-based utilities that format, validate, and convert data locally. No accounts, no ads, no backend data collection.