ToolJutsu
All tools
Developer Tools

Base64 Encoder & Decoder

Encode and decode Base64, with full UTF-8 support.

0 B
Processed on your device. We never see your files.

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

  1. Choose Encode or Decode with the toggle at the top.
  2. To encode text, type or paste it into the input box — the Base64 output appears below instantly.
  3. 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.
  4. To decode, paste a Base64 string into the input. The decoded text appears below as soon as the string is valid.
  5. 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.
  6. 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?
No. Encoding and decoding both run entirely in your browser using built-in JavaScript. Nothing you type, paste, or upload — including files — ever leaves your device, which you can confirm in your browser's Network tab.
Does this tool handle non-English text and emoji correctly?
Yes. Text is encoded as UTF-8 before being converted to Base64, so accented characters, non-Latin scripts, and emoji round-trip cleanly. Decoding reverses the process the same way.
Can I encode an image, PDF, or other binary file?
Yes. Switch to Encode mode and upload or drag a file onto the input. The file is read as raw bytes and turned into Base64. In Decode mode you can do the reverse and download the result as a file.
Why is my Base64 reported as invalid when decoding?
Valid Base64 uses only A-Z, a-z, 0-9, plus, and slash, with a length that is a multiple of four (padded with equals signs). Stray characters, URL-safe symbols, or missing padding will fail the check. Remove anything unexpected and try again.
Does Base64 encryption make my data secure?
No. Base64 is an encoding, not encryption. Anyone can decode it instantly, so it offers no secrecy. Use it to transport data safely through text-only channels, not to protect it.

Related tools