TF

Developer Tools

Base64 Encode and Decode Online

Encode and decode Base64 text or files live — URL-safe, MIME, and data URIs.

Runs locally in your browser — your input is not uploaded.

Type text or choose a file — the result updates as you type.

Need Base32, Hex, Binary, Base58, or Base85? Try the Encoder / Decoder.

What is this tool?

Base64 shows up in data URLs, email attachments, basic-auth headers, and API payloads. Type or paste to convert live, or drop in any file to get its Base64 or a ready-to-paste data URI. Decoding works the other way: readable text appears instantly, and images, PDFs, and other binary data can be previewed or downloaded.

Base64 represents binary data using a safe ASCII alphabet. It is common in data URLs, email attachments, and API payloads.

Encoding expands size by roughly 33%. URL-safe Base64 (Base64URL) replaces + and / with - and _ and is used in JWTs and URLs. MIME email wraps lines at 76 characters.

Your text and files never leave your device — encoding and decoding happen in the browser.

How to use the Base64 Encoder / Decoder

  1. Choose Encode or Decode.
  2. To encode, type or paste text, or switch to File and choose any file. The result updates as you type.
  3. Pick options if you need them: URL-safe alphabet, no padding, 76-character MIME lines, or a data URI prefix for files.
  4. To decode, paste Base64 (a data URI works too). Text appears right away; binary data such as images can be previewed and downloaded as a file.
  5. Copy or download the result, or use Swap direction to send it back the other way.

Examples

Encode a greeting

Hello
SGVsbG8=

Frequently asked questions

Can I convert a file or image to Base64?

Yes. Switch to File, choose any file up to 10 MB, and copy the Base64. Turn on Add data URI prefix to get a string you can paste straight into an HTML img tag or CSS.

How do I turn Base64 back into a file?

Choose Decode and paste the Base64. ToolForge detects the file type (PNG, JPEG, PDF, ZIP, and more), previews images, and gives you a download button.

Is Base64 a form of encryption?

No. Base64 is an encoding, not encryption, and anyone can decode it. Never rely on it to hide passwords or secrets.

Does it accept URL-safe Base64?

Yes. When decoding, - and _ are treated as + and /, missing = padding is added, and line breaks and data URI prefixes are ignored. When encoding, tick URL-safe to produce Base64URL.

Why is the encoded text longer than the original?

Base64 uses four characters for every three bytes of input, so the output is about 33% larger.

Want more power later?

Premium tools, higher limits, and API access are on the roadmap. V1 stays free and private in your browser.