Base64 Encoder/Decoder
Encode text to Base64 or decode Base64 to text.
Plain text
Input 0 B
Result
Output 0 B
Advanced options
Encode-each-line and split-into-76-characters cannot be enabled at the same time.
What is Base64 encoding?
Base64 turns binary data into plain ASCII characters so it can travel safely through channels that only accept text — JSON bodies, data URLs, email headers and config values. It is an encoding, not encryption: anyone can decode it.
This tool encodes text and files to Base64 and decodes Base64 back to text or a file, entirely in the browser. Files are read through the FileReader API and never transmitted.
How to encode or decode Base64
- Pick a mode: Encode to turn readable data into Base64, or Decode to turn Base64 back into readable data.
- Choose the source: Text for typed input, or File to load an image, document or any binary file from disk.
- Type or paste into the left pane, or select a file. The result updates in the right pane as you type.
- Optional: turn on URL-safe for URL and filename friendly output, Wrap at 76 for MIME-style line breaks, or data: URL prefix to embed the output in HTML or CSS.
- When decoding, pick the character set (UTF-8, UTF-16 LE or ISO-8859-1) that the original bytes used.
- Press Copy or Download for text output; when decoding to a file, set the filename and MIME type, then press Download decoded file.
Base64 examples
A round trip, the effect of URL-safe output, and decoding a value back to JSON.
Plain text (UTF-8)
UrsaKit
VXJzYUtpdA==
URL-safe output
subjects?_d=1
c3ViamVjdHM_X2Q9MQ
Decode back to JSON
eyJvayI6dHJ1ZX0=
{"ok":true}data: URL prefix
UrsaKit
data:text/plain;charset=utf-8;base64,VXJzYUtpdA==
Base64 vs other encodings
| Dimension | Base64 | Hex | URL encoding |
|---|---|---|---|
| Size overhead | ~33% larger | 100% larger | 3–9% per escaped byte |
| Character set | A–Z a–z 0–9 + / = | 0–9 a–f | ASCII with %XX escapes |
| Typical use | Binary in JSON, data URLs | Hashes, byte dumps | Query strings |
| Human readable | No | No | Partly |
Base64 FAQ
Is Base64 encryption?
No. Base64 is a reversible encoding — anyone who has the string can decode it. Use real encryption if the content is sensitive.
Why is the output longer than the input?
Three bytes of input become four ASCII characters, so the encoded string is about 33% larger than the original.
What is URL-safe Base64?
Standard Base64 uses + and /, which have special meaning inside URLs. URL-safe Base64 replaces them with - and _ and drops the = padding so the string can sit in a query parameter or filename.
Does this tool upload my file?
No. Files are read in the browser with the FileReader API; nothing is sent to a server.
Can I decode a string without padding?
Yes. Missing = padding is restored automatically when the length is unambiguous, and both standard and URL-safe alphabets are accepted.
How do I decode Base64 back into an image?
Switch to Decode, choose the File source, paste the Base64 string or data: URL, then set the MIME type (for example image/png) and press Download decoded file.
Is it free?
Yes, unlimited and without an account.