Base64 Encoder
Encode and decode text or files to and from Base64 instantly.
- 🔒 100% in-browser
- ⚡ Instant results
- 🆓 Free, no sign-up
Base64 EncoderFree · No signup
Loading tool…
Base64 is a text encoding scheme that turns binary data or special characters into a plain ASCII string so it can travel safely through URLs, HTML, CSS, JSON, API payloads, and email. Need to tidy your text first? Try our case converter before encoding.
This free Base64 encoder and decoder runs entirely in your browser. Nothing is uploaded, so your data stays private. Text is handled as UTF-8, which means emoji, accented letters, and non-Latin scripts encode and decode correctly instead of turning into garbled characters.
It is useful for developers, designers, and technical teams who need to embed small assets as data URIs, inspect encoded API payloads, or build Basic Auth headers without installing anything.
How to Use the Base64 Encoder
Choose Encode to turn text or a file into Base64, or Decode to turn a Base64 string back into readable text.
Paste your text into the input area, or drag a file into the drop zone. The output updates instantly.
Review the result, then click Copy output to paste it into your HTML, CSS, JavaScript, or API request.
🔒 Privacy: everything runs in your browser. Your text and files are never uploaded, processed on a server, or stored.
Common Uses for Base64
Data URIs
Embed small images or fonts directly in HTML and CSS to save an extra network request.
HTTP Basic Auth
Basic Auth headers use Base64 of username:password. Encode the pair and prefix it with “Basic ”.
Inspecting JWTs
JWT header and payload segments are Base64URL-encoded JSON. Decode them to read the claims.
Safe data transport
Send binary content through systems that only handle plain text, such as JSON fields or email.
Troubleshooting Decode Errors
- “Invalid Base64” or garbled output
- Check that the string has no stray spaces, quotes, or line breaks, and that it is complete. A truncated string cannot decode.
- Missing padding (= signs)
- Standard Base64 length must be a multiple of 4. If the trailing = characters were stripped, add them back until the length fits.
- String contains - and _ instead of + and /
- That is Base64URL, used in JWTs and URLs. Replace - with + and _ with / (and restore padding) before decoding as standard Base64.
- Decoded text looks like symbols
- The original data was probably binary (an image or file), not text. Decode it as a file instead of reading it as text.