Base64 Encoder & Decoder
Encode and decode Base64, with full UTF-8 support.
How to use Base64 Encoder & Decoder
What this tool does
Base64 is a way of representing arbitrary binary data — bytes — using only 64 printable characters. This tool converts in both directions. Encode takes text or a file and produces a Base64 string. Decode takes a Base64 string and gives you back the original text, or lets you download it as a file when the data is binary. Text is handled as UTF-8, so anything from plain ASCII to emoji survives a round trip unchanged. Every conversion happens inside your browser using built-in JavaScript, so the data you paste or upload is never sent anywhere.
Why you might need it
Plenty of systems can only carry plain text reliably. Email was designed for
7-bit text, JSON has no native binary type, environment variables and YAML files
are text, and many APIs expect credentials or small payloads as strings. Base64
solves this by re-expressing raw bytes as text that survives those channels
intact. You will meet it constantly: data URIs that embed an image directly in
HTML or CSS (data:image/png;base64,...), the payload and header of a JSON Web
Token, HTTP Basic Authentication headers, certificates in PEM format, and
binary attachments inside structured documents. When something arrives as a long
run of letters, digits, +, /, and trailing = signs, it is almost certainly
Base64, and this tool will turn it back into something readable or usable.
How to use it
- Choose Encode or Decode with the toggle at the top.
- To encode text, type or paste it into the input box — the Base64 output appears below instantly.
- To encode a file, use the file picker or drag a file straight onto the input area. The tool reads the file’s bytes and encodes them.
- To decode, paste a Base64 string into the input. The decoded text appears below as soon as the string is valid.
- In Decode mode you can also name the output and click Download as file to save the decoded bytes — handy when the Base64 represents an image or PDF.
- Use Copy output to grab the result, and Clear to start over.
The byte counters under each box show how the size changes. Base64 always grows data by roughly a third, because every three bytes become four characters.
Common pitfalls
The most common confusion is treating Base64 as a security measure. It is not encryption — it hides nothing, and anyone can decode it in seconds. If you need secrecy, encrypt the data first and Base64 the ciphertext afterwards.
Decoding failures usually come from a string that is not standard Base64. Watch
for URL-safe Base64, which swaps + and / for - and _; that variant
will not decode here without first converting those characters back. Missing
padding is another trap: standard Base64 length must be a multiple of four, with
= filling any gap. Stray whitespace inside a pasted string is tolerated and
stripped automatically, but other invisible characters are not.
Finally, remember that decoding binary data to the text box will show garbled characters — that is expected. For binary, use the download button instead of reading the output as text.
Tips and advanced use
To build a data URI by hand, encode your file here and prepend the right MIME
prefix, for example data:image/svg+xml;base64, followed by the output. To
inspect a JWT, copy its middle segment and decode it to read the claims — though
note JWTs use the URL-safe variant, so you may need to convert - and _ first.
Because every operation is client-side, it is genuinely safe to encode files or strings that contain API keys, internal identifiers, or customer data — none of it is uploaded. That also means the tool keeps working offline once the page has loaded. For very large files the conversion runs on your own device, so it may pause the page briefly while the bytes are processed.
Frequently asked questions
Is my data sent to a server when I use this tool?
Does this tool handle non-English text and emoji correctly?
Can I encode an image, PDF, or other binary file?
Why is my Base64 reported as invalid when decoding?
Does Base64 encryption make my data secure?
Related tools
Base64 Decoder
Decode Base64 strings back to UTF-8 text in your browser.
URL Encoder & Decoder
Encode and decode URL-safe text.
HTML Encoder & Decoder
Encode and decode HTML entities.
JWT Decoder
Decode and inspect JSON Web Token headers and payloads.
Hash Generator
Generate MD5, SHA-1, SHA-256, and SHA-512 hashes.
UUID Generator
Generate v1 and v4 UUIDs in bulk.