Luminesca Tools
All Tools / Developer

Developer / TOOLKIT

Base64 Encoder / Decoder

Last updated:

Encode text to Base64 or decode it back. UTF-8 safe, and files become embeddable data URLs.

Free to use · No account needed

How to use

  1. Type or paste text into the input box.
  2. Click Encode to get its Base64 form, or Decode to turn Base64 back into readable text.
  3. Use Swap to move the result back into the input, and Copy result to grab it.
  4. For files, pick any file to receive a data URL ready for embedding.

Base64 encoding is everywhere in modern development. Developers use it to embed small images directly in CSS and HTML as data URLs, transmit binary data through JSON APIs, and store attachments in text-only protocols like email. Security teams also use Base64 to obfuscate tokens before logging. Whether you need to encode an image, decode a JWT payload segment, or prepare data for an API request, this tool handles both directions instantly and never uploads your data - everything runs locally in your browser.

Use cases

1. Use case: Embed images in HTML/CSS Convert a small logo to Base64 and paste the data URL directly into CSS, eliminating an extra HTTP request on landing pages.

2. Use case: Send data in JSON APIs Encode binary content (like a signature image or config blob) as Base64 so it can travel safely inside a JSON payload.

Practical tips

Base64 is encoding, not encryption — anyone can decode it, so never treat it as protection for secrets. Expect roughly a 33 percent size overhead; it exists to move binary data through text-only channels, not to save space. Padding characters at the end are part of the format, and the URL-safe variant swaps two characters for use in links — pick the variant your destination expects. Common uses: embedding small images in CSS, basic auth headers, and data URIs. Like every tool on this site, the Base64 Encoder runs entirely in your browser: the data you enter never leaves your device, nothing is uploaded to a server, and the tool keeps working if your connection drops.

Common mistakes

Base64 is transport encoding; the mistakes are in treating it as more:

  • Treating Base64 as encryption — anyone can decode it, so it is not protection for secrets.
  • Forgetting the roughly 33 percent size overhead and using it to 'compress' data, which does the opposite.
  • Mixing standard and URL-safe variants: they swap two characters, and a destination expecting one will reject the other.
  • Dropping the padding characters at the end; they are part of the format and some decoders require them.

Boundary and failure cases

Base64 is an encoding, not encryption. Anyone who receives the string can decode it. Do not treat it as a way to hide secrets in URLs, source code or support tickets.

Standard Base64 and base64url differ on + / versus - _ and on padding. JWT segments use base64url without relying on padding the way some decoders do. Prefer the variant named in the destination specification; mixing them produces strings that look almost right and fail signature or checksum checks.

Text mode uses UTF-8. Pasting binary into a text box, or decoding with the wrong character set, corrupts bytes that happen to look like text. For files, use the file picker so the exact octet stream is read. Very large files may hit browser memory limits even though nothing is uploaded.

Frequently asked questions

Does the Base64 Encoder send my data anywhere?

No. Encoding and decoding run in your browser. Text and file bytes are not uploaded by this tool.

Why is Base64 output longer than the input?
Every three bytes become four characters. The expansion is the cost of carrying binary through text-only channels such as JSON, XML, email and data URLs.
When is the URL-safe variant required?
When the value travels in a URL or filename. Standard + and / are special there. JWTs and many cloud signed-URL schemes use base64url.
Does Base64 encrypt my data?
No. It only changes representation. Use a real cryptographic primitive when confidentiality or integrity is required.
Why does decode fail with a padding error?
Length must be a multiple of four after padding with =, unless you are using a base64url profile that omits padding. Strip whitespace and confirm you did not mix standard and URL-safe alphabets.
Does this tool support non-English characters?
Yes in text mode via UTF-8. Emoji and CJK characters encode correctly when you stay in text mode rather than treating the string as Latin-1.
Can I convert a file to Base64?
Yes. Pick a file to build a data URL or raw Base64. Bytes stay in the tab; closing it clears the result.