Base64 Encode and Decode

Encode and decode text (UTF-8, URL-safe) and files to Base64 or data URI and back. Free, no sign-up, everything runs in your browser.

🔒 Runs in your browser

About this tool

Convert text and files to Base64 and back in one place. Encode UTF-8 text with optional URL-safe output, turn an image or any file into a data URI, CSS or HTML snippet, or restore a file from a Base64 string. It is free, needs no sign-up and works entirely in your browser.

How to use

  1. Pick a tab: Text, File to Base64, or Base64 to file.
  2. For text, choose Encode or Decode and type or paste your input; tick URL-safe or 76-character lines if needed.
  3. For a file, drop it on the page and choose Data URI, plain Base64, CSS background-image or HTML img output.
  4. To get a file back, paste Base64 or a data URI, check the detected type and click Download file.

Frequently asked questions

Are my files uploaded anywhere?

No. Encoding and decoding happen locally in your browser, and files are never sent to a server.

What is URL-safe Base64?

It replaces + and / with - and _ and drops the trailing = padding, so the string can be used in URLs and file names. The decoder accepts both variants, with or without padding.

Why does decoded Base64 not show as text?

If the decoded bytes are not valid UTF-8 text, they are probably a binary file such as an image. Use the Base64 to file tab: it detects the file type from its content and lets you download it.

Why is the Base64 version larger than the file?

Base64 represents every 3 bytes with 4 characters, so the result is about 33% larger. The tool shows the exact size before and after encoding.