Skip to content
Image tools
PDF and scan tools
Video and audio tools
Text and everyday tools
Bangladesh tools
How-to guides
Image tools
PDF and scan tools
Video and audio tools
Text and everyday tools
Bangladesh tools

Base64 encode and decode

ProPro
Loading the tool…

Encode text or any file to Base64, or decode Base64 back to text or a file. Supports UTF-8, URL-safe Base64 and data URLs. Nothing is uploaded.

What this Base64 tool does

This free Base64 encoder and decoder converts text to Base64 and back, and turns any file into Base64 or a data URL. Text is handled as UTF-8, so accents, emoji and every alphabet survive the round trip. When the Base64 you decode is really a file, such as a PNG or a PDF, you can download it as that file.

How to encode or decode text

  1. On the Text tab, choose Encode or Decode.
  2. Type or paste into the left box. The result appears on the right as you type.
  3. For links and tokens, switch on URL-safe (Base64url) when encoding.
  4. Click Copy, or Use result as input to reverse the step.

How to encode a file

  1. Open the File tab and drop a file (up to 10 MB), or click to choose one.
  2. Pick the Output: Plain Base64, Data URL or URL-safe (Base64url).
  3. Click Copy or Download to save the Base64 as a text file.

Very long results show only the first 100,000 characters on screen to keep the page fast. Copy and Download always use the full result.

What decoding accepts

  • Standard Base64 with or without = padding.
  • URL-safe Base64 with - and _.
  • Line breaks and spaces, which are ignored (common in emails and PEM files).
  • Full data URLs such as data:image/png;base64,iVBOR….

Problems and fixes

  • “… isn’t a Base64 character.” Something other than Base64 slipped in, often a quote mark or part of the surrounding code. Copy only the Base64 itself.
  • “This Base64 is cut off.” A character is missing at the end. Copy the full value again.
  • The decoded text looks garbled. The original wasn’t UTF-8 text, or it was a file. If the tool shows a file, download it.

Privacy

Encoding and decoding run in your browser. Text and files stay on your device.

When Pro helps

Pro doesn’t add anything to this tool beyond removing ads.

Frequently asked questions

Is Base64 encryption?

No. Base64 only rewrites data using 64 safe characters so it can travel through email, JSON or URLs. Anyone can decode it, so never use it to hide passwords or secrets.

Why is the Base64 bigger than my file?

Base64 turns every 3 bytes into 4 characters, so the result is about 33% larger than the original. A 300 KB image becomes roughly 400 KB of text.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in web addresses. URL-safe Base64 (Base64url) uses - and _ instead and drops the = padding. It is used in JSON Web Tokens, links and file names. The decoder here accepts both kinds.

How do I turn an image into a data URL?

Open the File tab, drop the image and choose Data URL. You get text starting with data:image/png;base64, which works directly in an img src or a CSS background. Keep it to small images, since large data URLs slow pages down.

How do I turn Base64 back into an image or file?

Paste it into the Text tab with Decode selected. When the data is a file rather than text, the tool says what type it is, shows a preview for images, and gives you a Download file button.