Base64 Encoder & Decoder

Convert text or files to Base64 and back, with full Unicode support and optional URL-safe output.

How Base64 Encoder works

Encode or decode Base64 text and files instantly. Unicode safe, no upload, no server involved. Everything happens inside this page: the tool reads your input, runs the calculation or conversion locally, and hands the result back to you. Nothing is transmitted, because there is no backend to transmit it to.

That design choice is deliberate. Most free tool sites upload your files to a server, process them there, and quietly keep a copy. Toolcin cannot do that — the site is a set of static files. If your connection dropped the moment the page finished loading, every tool would still work.

What Base64 is for

Base64 turns arbitrary bytes into 64 safe characters so they can travel through systems that only accept text: JSON fields, email headers, data URLs, HTTP basic auth. It exists because some channels mangle bytes but never mangle A–Z, a–z, 0–9, + and /.

It is not encryption and it is not compression. The output is about 33% larger than the input, and anyone can reverse it in one line of code. Anything secret must be encrypted before it is encoded.

Unicode, and why naive encoders break

The browser's btoa function only accepts one byte per character. Hand it text with an emoji or an Urdu letter and it throws an error. This tool converts the text to UTF-8 bytes first and then encodes those bytes, so any language and any emoji survive the round trip.

Decoding goes the other way: Base64 becomes bytes, then bytes are decoded as UTF-8. If the original was not UTF-8 text — a PNG, for example — the decoded result will look like garbage, because it is binary data being read as text.

URL-safe mode

Standard Base64 uses + and /, which have meaning inside a URL. URL-safe Base64 (RFC 4648 §5) swaps them for - and _, and usually drops the trailing = padding.

This tool applies both changes when the box is ticked, on encode and on decode. If you paste a URL-safe string with the box unticked, the - and _ will be treated as invalid characters — that mismatch is the most common reason a decode fails.

VariantCharacter 62Character 63PaddingUsed in
Standard+/= keptEmail, JSON, data URLs
URL-safe-_= droppedJWT, URLs, filenames

Files and data URLs

The file option reads an image or other binary file and returns its data URL form — the mime type, then base64, ready to paste into a CSS background or an img src. This is convenient for small icons and wasteful for anything large, because the encoded copy is a third bigger and cannot be cached separately from the page.

As a rule of thumb, inline a file only if it is under about 5 KB. Above that, a normal URL and a cache header will be faster and easier to maintain.

Good to know

  • Works offline once loaded, including on flights and in locked-down networks.
  • No file size limit beyond your device's own memory.
  • Free to use, with no account and no usage counter.
  • Results are produced locally, so they are not logged or shared with anyone.

Questions

Does it support Unicode and emoji?

Yes. Text is converted through UTF-8 before encoding, so accents, Arabic, Urdu and emoji all survive a round trip.

What is URL-safe Base64?

It replaces + and / with - and _ so the string can be used inside URLs and filenames.

Is Base64 decoding safe for untrusted text?

Decoding itself is harmless, but the result may be binary. Never execute or open decoded output you did not expect.

Why does my decoded text have strange characters?

The bytes were not UTF-8 text to begin with. Decoding always produces bytes; interpreting them as text only works if they were text.

Keep going

More encoding tools