Base64 Encoder / Decoder

Encode and decode text (UTF-8, any language) and files to Base64, with a URL-safe option.

Convert a file to Base64

Image or file up to 5MB — returns a ready-to-use Data URI for HTML/CSS

This tool runs entirely in your browser — no data is uploaded to our servers.

Was this tool helpful?

What is Base64?

Base64 represents binary data — images, files, text in any language — using only 64 safe characters (A–Z, a–z, 0–9, + and /). It is used to move data through text-only channels: email, APIs, JWT tokens, and embedding images directly in HTML/CSS as Data URIs.

Important: Base64 is an encoding, not encryption. Anyone can decode it, so never use it to hide passwords or sensitive data.

How to use it

  1. Choose Encode or Decode.
  2. Type or paste your input; the output updates instantly.
  3. Enable “URL-safe” to replace + and / with - and _ and strip = padding.
  4. “Swap” moves the output to the input and flips the mode to verify the result.
  5. Use “Convert a file to Base64” to get a ready Data URI for images or files.

Why it handles any language correctly

The browser’s built-in btoa only accepts Latin-1 characters and fails on Arabic or emoji. This tool converts text to UTF-8 bytes first, so it works with any language and decodes back to the exact original text.

When to use Data URIs

Inlining very small icons saves an HTTP request but adds about 33% to the size. For larger images, upload compressed files instead.

Frequently asked questions

Is Base64 secure encryption?

No. It is a reversible encoding and provides no protection.

Why is the output larger?

Every 3 bytes become 4 characters, about 33% larger.

What is URL-safe Base64?

It replaces +, / and = so the data survives inside URLs.

Is my data sent anywhere?

No, processing is local.