Base64 Encode and Decode: Text and Files, UTF-8 Safe

Convert text or a file to Base64 and back. Non-English characters are handled as UTF-8, and a URL-safe option is available.

Loading tool…

How to use the Base64 Encode & Decode

  1. Choose Encode or Decode.
  2. Type or paste your text, or drop a file to encode it.
  3. Optionally choose URL-safe, 76-character MIME lines or a data: URI prefix.
  4. Copy or download the result. Decoded images are previewed.

About this tool

Base64 represents binary data using 64 plain characters (A to Z, a to z, 0 to 9, + and /) so it can travel through systems that only handle text, such as JSON, email or data URIs. The output is about one third larger than the input.

Text is first converted to UTF-8 bytes, so Hindi text or the rupee sign decode back exactly. Options: URL-safe replaces + and / with - and _ and drops the = padding, as used in JWTs; wrapping at 76 characters gives the MIME layout used in email and PEM files; the data: URI prefix turns the result into something you can use directly in HTML or CSS. When you decode, a data: prefix is removed automatically.

If the decoded bytes are not text, the tool recognises common types (PNG, JPEG, GIF, WebP, PDF, ZIP, gzip) and offers a download with the right extension, and images are shown as a preview. Only UTF-8 text is supported, not other character sets. Base64 is not encryption: anyone can decode it, so never use it to hide a password or key.

Frequently asked questions

Is Base64 secure?

No. It is an encoding, not encryption, and anyone can decode it.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / and omits padding, so the value can sit in a URL or filename.

Can I encode an image or PDF, and decode back to a file?

Yes. Drop or choose a file to get Base64 or a data URI. Pasting Base64 (or a data: URI) in Decode mode gives a preview for images and a download button for any binary file.

How do I get 76-character lines?

Turn on Wrap lines at 76 characters (MIME) when encoding.

Why does decoding show an error?

The input contains characters that are not Base64 or has an invalid length. Remove stray characters and try again.

Need a custom tool or website?

IDM Valley builds web apps, calculators, AI chatbots and automation for businesses. Fixed prices, code in your name.

Get a free quote

Have a project in mind?

Tell us what you need: a website, landing page, AI chatbot or automation. You get a clear scope and a fixed price within one working day. Free, no obligation.


  • avshack
  • DivineBamboo
  • goldleaf
  • janapril
  • kaizen
  • kwc
  • modv
  • pixelrush
  • revital
  • riderzplanet
  • sandsfashions
  • avshack
  • DivineBamboo
  • goldleaf
  • janapril
  • kaizen
  • kwc
  • modv
  • pixelrush
  • revital
  • riderzplanet
  • sandsfashions