Base64 Encode & Decode
Encode text or files to Base64, or decode Base64 strings back to readable text. Supports full Unicode, URL-safe variants, and live updates as you type.
Text to Encode
0 charsBase64 Output
What is Base64?
Base64 is a standard encoding that converts binary data into a set of 64 printable ASCII characters. It's widely used in web development to embed images in CSS/HTML, send binary data in JSON APIs, encode email attachments (MIME), and store credentials in HTTP headers.
How to use this tool
- Choose Encode or Decode mode.
- Type, paste text, or upload a file.
- The result updates live as you type.
- Click Copy to grab the output.
Common use cases
- Embedding small images as
data:image/png;base64,...URIs - Encoding binary data for JSON API payloads
- Decoding Base64-encoded JWTs, cookies, or auth tokens
- Converting files to Base64 for email attachments
- Encoding credentials for HTTP Basic Auth headers
Technical details
This encoder converts text to UTF-8 bytes, then maps every 3 bytes to 4 Base64 characters using the standard alphabet (A-Z, a-z, 0-9, +, /) with '=' padding. The decoder auto-detects URL-safe variants (- and _ instead of + and /) and handles missing padding gracefully.
Frequently Asked Questions
What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) to encode data, making it safe to transmit over text-only channels like email, URLs, or JSON.
Does this tool upload my data anywhere?
No. All encoding and decoding happens entirely in your browser using JavaScript. Nothing is sent to any server — your data stays on your device and disappears when you close the page.
Can I encode files (images, PDFs) to Base64?
Yes. Click 'Upload File' to select any file. It will be read in your browser and converted to a Base64 string. This is commonly used for embedding images in CSS/HTML or sending binary data in JSON APIs.
Does it handle Unicode / emoji?
Yes. The encoder converts text to UTF-8 bytes first, then encodes those bytes to Base64. This correctly handles all Unicode characters including emoji, accented characters, CJK, and more.
What's URL-safe Base64?
URL-safe Base64 replaces '+' with '-' and '/' with '_' to avoid issues in URLs. This decoder automatically detects and handles both standard and URL-safe Base64 input.
Why does Base64 make data ~33% larger?
Base64 encodes 3 bytes of binary data into 4 ASCII characters. This 4/3 ratio means the encoded output is always about 33% larger than the original. The tradeoff is universal text-safe transportability.
Related tools
More free, private, browser-based utilities — no upload, no sign-up.

Davemi Tools