Base64 Encoder/Decoder

Base64 turns data into text that’s safe to carry through systems built for words: three bytes at a time become four characters from a 64-character alphabet, so a value can travel inside a config file, a token, a URL or an email without breaking anything on the way. This tool converts in both directions — your text to Base64, or a Base64 value back to the text it came from — updating live as you type or paste.

The detail that decides whether a tool like this actually works is Unicode. Base64 encodes bytes, and text becomes bytes through UTF-8. Plenty of simple converters skip that step and encode character by character, which holds up for plain English and then fails — with an error, or worse, with quietly wrong output — the moment your text holds an accented letter, a currency sign, a line of Japanese or an emoji. This converter encodes the UTF-8 bytes, so café ☕ converts as happily as hello, in both directions.

Decoding is built for the way values actually arrive. A string copied out of a web token or a URL comes without its padding and with two characters swapped; a string copied out of an email arrives wrapped across lines. Paste either kind here and it decodes as it stands — and if a value genuinely isn’t valid Base64, you get a sentence explaining what’s wrong instead of a blank box or a garbled guess.

A desk with a monitor showing blurred rows of encoded-looking text and a notebook with hand-drawn arrows between two text blocks.

Base64 Encoder/Decoder

Encode text to Base64 or decode it back — with accents, CJK and emoji handled properly, because the conversion runs on UTF-8 bytes rather than a shortcut that stops at Latin-1.

Uses the URL- and filename-safe alphabet from RFC 4648 section 5: minus and underscore in place of plus and slash, with the padding left off — the shape used in web tokens and links.

How the conversion works: your text is first turned into UTF-8 bytes, and it is the bytes that are encoded — which is why an accented letter or an emoji survives the trip, where a simpler tool that encodes character by character stops with an error. Decoding runs the same road backwards and checks the result is valid UTF-8 text; if a pasted value is not valid Base64, the message above the buttons says what is wrong instead of showing a garbled guess. Base64 is an encoding, not encryption — anyone holding the encoded text can decode it. Everything happens in this tab: nothing you paste is sent anywhere, stored, or tracked.

How it works

The encoding follows RFC 4648, the document that defines Base64. Your text is passed through the browser's TextEncoder, which produces its UTF-8 bytes; those bytes are grouped three at a time and written out as four characters from the standard alphabet — A–Z, a–z, 0–9, + and / — with = padding at the end so the length always lands on a multiple of four. Decoding runs the same road in reverse and finishes with TextDecoder, which reads the bytes back as UTF-8 text and reports an error rather than guessing if they aren't valid text.

Tick URL-safe variant in Encode mode and the output switches to the second alphabet the RFC defines, in section 5: - stands in for +, _ stands in for /, and the padding is left off. Those two standard characters mean other things inside a URL — a + reads as a space, a / as a path break — so the URL-safe shape is the one used in links, filenames and web tokens. It carries exactly the same data; only the spelling changes.

The decoder accepts both alphabets whether or not the toggle is set, because you rarely get to choose the shape of a value someone hands you. It also ignores whitespace anywhere in the paste, and adds back missing padding before decoding. What it won't do is rescue a value that isn't Base64: a character outside the alphabet, a length that can't occur, padding stranded in the middle, or bytes that decode to something other than UTF-8 text each produce their own plain message, and the output stays empty rather than filling with nonsense.

One thing worth stating plainly, because it's confused constantly: Base64 is an encoding, not encryption. It has no key and no secrecy — anyone who holds the encoded text can decode it in seconds, which is the entire point of the format. Use it to move data safely through text-only places, never to hide anything.

How to use it

  1. Choose Encode or Decode at the top. The input and output boxes relabel themselves so you always know which side takes what.
  2. Type or paste into the input box. The result appears in the output box as you go — there's no convert button to press — with a character count under each side.
  3. When encoding for a URL, a filename or a token, tick URL-safe variant before you copy. For anything else, leave it off and you'll get the standard form.
  4. Click Copy result to take the output, or Swap to move the output into the input with the mode flipped — the quick way to prove a value round-trips exactly.
  5. If a decode shows a message instead of a result, it names the problem: check the paste for a missing character at either end, or a stray character that crept in.
  6. Use Try an example if you want to see the round trip first — it loads the café example below in whichever mode you're in.

A worked example

Type Hello, World! in Encode mode and the output is:

SGVsbG8sIFdvcmxkIQ==

Thirteen characters of text became twenty characters of Base64, ending in == — the padding that rounds the length up to a multiple of four. Switch to Decode, paste that value back, and you get Hello, World! again, character for character.

Now the example that separates converters. Type café ☕ — an accented word, a space, and a coffee emoji — and the output is:

Y2Fmw6kg4piV

No padding this time, because the UTF-8 bytes behind those five characters happen to divide evenly by three. The accent and the emoji are simply more bytes to the encoder; nothing about them is special once the text has been turned into UTF-8, which is the step the failing tools skip. Paste Y2Fmw6kg4piV into Decode mode and café ☕ comes back exactly. And for the URL-safe shape: encode ???? with the variant ticked and you get Pz8_Pw — where the standard form is Pz8/Pw==, the slash has become an underscore and the padding is gone.

Who it is for

Developers decoding a value out of a token, a header or a config file and re-encoding it after a change; support and operations staff who get handed encoded strings in tickets and logs; anyone embedding a short text payload in a data URI or a settings file; and anyone who has watched a simpler converter refuse their text because it contained an accent or an emoji, and wants one that just handles it.

Why use this tool

  • Unicode handled properly — text is encoded as UTF-8 bytes, so accented words, CJK and emoji convert cleanly in both directions instead of hitting the Latin-1 wall that stops simpler tools.
  • A decoder that accepts values as they arrive — standard or URL-safe alphabet, padding present or missing, line breaks through the middle: paste it as it comes and it decodes.
  • Errors that say what's wrong — an invalid character, an impossible length, bytes that aren't text: each gets a plain sentence naming the problem, never a silent blank or a garbled guess.
  • Both alphabets, one toggle — standard Base64 for files and configs, the RFC 4648 URL-safe variant for links and tokens, with Swap to check any value round-trips exactly.

Frequently Asked Questions

What is Base64 encoding?

It's a way of writing data as plain text, defined by RFC 4648. Every three bytes of data become four characters chosen from a 64-character alphabet, so the result can pass safely through systems that only handle text — email, JSON, URLs, config files. It changes how data is written, not what it says, and it adds roughly a third to the size.

Why do accents and emoji break some Base64 tools?

Because Base64 encodes bytes, and a character isn't always one byte. The browser's quick built-in encoder treats each character as a single byte, which works only for the Latin-1 range; an accented character beyond it, or any emoji, makes it give up. This tool converts your text to UTF-8 bytes first — the step that makes every character encodable — and decodes the bytes back the same way.

What is URL-safe Base64, and when should I use it?

It's the variant defined in section 5 of RFC 4648: - replaces +, _ replaces /, and the = padding is usually left off. Use it whenever the encoded value will sit inside a URL, a filename or a token — the standard characters have meanings of their own in those places, and a / in a link or a + read as a space will corrupt the value. The data is identical; only the spelling is safer.

Why won't my Base64 value decode?

The usual causes are a character missing from either end after copying, a stray character that isn't in the alphabet, or a value that was never text to begin with — a file's bytes decode fine as Base64 but aren't readable text. This tool checks for each case and tells you which one it found, instead of printing whatever comes out.

Is Base64 a safe way to hide passwords or secrets?

No. Base64 is an encoding, not encryption: there's no key, and anyone holding the encoded text can turn it back in seconds. It protects data from being mangled by text-only systems, not from being read. If something needs to stay secret, it needs encryption — Base64 can carry the encrypted result, but it does no protecting itself.

Is anything I paste uploaded or saved?

No. The conversion runs in your browser, on your device, as you type; nothing is sent to a server, stored or tracked. That's worth having in a tool people paste tokens and configuration values into — close the tab and the text is gone with it, so copy the result before you leave.

What is Base64 encoding?

It's a way of writing data as plain text, defined by RFC 4648. Every three bytes of data become four characters chosen from a 64-character alphabet, so the result can pass safely through systems that only handle text — email, JSON, URLs, config files. It changes how data is written, not what it says, and it adds roughly a third to the size.

Why do accents and emoji break some Base64 tools?

Because Base64 encodes bytes, and a character isn't always one byte. The browser's quick built-in encoder treats each character as a single byte, which works only for the Latin-1 range; an accented character beyond it, or any emoji, makes it give up. This tool converts your text to UTF-8 bytes first — the step that makes every character encodable — and decodes the bytes back the same way.

What is URL-safe Base64, and when should I use it?

It's the variant defined in section 5 of RFC 4648: - replaces +, _ replaces /, and the = padding is usually left off. Use it whenever the encoded value will sit inside a URL, a filename or a token — the standard characters have meanings of their own in those places, and a / in a link or a + read as a space will corrupt the value. The data is identical; only the spelling is safer.

Why won't my Base64 value decode?

The usual causes are a character missing from either end after copying, a stray character that isn't in the alphabet, or a value that was never text to begin with — a file's bytes decode fine as Base64 but aren't readable text. This tool checks for each case and tells you which one it found, instead of printing whatever comes out.

Is Base64 a safe way to hide passwords or secrets?

No. Base64 is an encoding, not encryption: there's no key, and anyone holding the encoded text can turn it back in seconds. It protects data from being mangled by text-only systems, not from being read. If something needs to stay secret, it needs encryption — Base64 can carry the encrypted result, but it does no protecting itself.

Is anything I paste uploaded or saved?

No. The conversion runs in your browser, on your device, as you type; nothing is sent to a server, stored or tracked. That's worth having in a tool people paste tokens and configuration values into — close the tab and the text is gone with it, so copy the result before you leave.