Format Code Now
/
Encode & decodeBase64 Encode and Decode Next: URL Encode and Decode ›

Base64 Decode and Encode

ED-01

Paste Base64 and click Decode to read the text inside, or paste text and click Encode. Accents, non-Latin letters and emoji are handled as UTF-8.

Runs in your browser. Nothing is uploaded.

Text or Base64

Result

How to use it

  1. Paste Base64 or plain text into the box. Sample loads an example.
  2. Click Decode for Base64 to text, or Encode for text to Base64.
  3. To encode for a URL, tick URL-safe output first.
  4. Copy the result or download it as a .txt file.

What Decode accepts

Decode takes standard Base64, which uses + and /, and URL-safe Base64, which uses - and _. Padding with = is optional, and spaces or line breaks anywhere in the input are ignored, so Base64 wrapped across several lines works. The decoded bytes are read as UTF-8 text, so accents, non-Latin scripts and emoji come back correctly. A = anywhere except the end, or any other character outside A to Z, a to z, 0 to 9, +, /, - and _, makes the input invalid.

Encode, and what URL-safe changes

Encode turns your text into UTF-8 bytes and then into Base64, so Wörld 你好 is encoded correctly. The URL-safe output option replaces + with -, / with _, and drops the = padding, which suits values placed in URLs or file names. It only affects Encode; Decode reads both kinds. Base64 is an encoding, not encryption, so anyone can decode it.

When decoding fails

There are three messages. One says the input has characters outside the Base64 alphabet. A common cause is a data: prefix such as data:image/png;base64, which must be removed so only the part after the comma remains. Another says the length is impossible, which means one stray character at the end, often from a truncated copy. The third says the decoded bytes are not UTF-8 text, as with an image or other binary file. This page decodes to text only, so it cannot save a binary file.

Questions people ask

How do I decode Base64 online?

Paste the Base64 string into the box and click Decode. The text appears in the result box, ready to copy or download. Standard and URL-safe Base64 both work, with or without = padding, and nothing is uploaded; it runs in your browser.

How do I encode text to Base64?

Paste the text and click Encode. The text is converted to UTF-8 bytes and then to Base64, so accents, other alphabets and emoji work. Tick URL-safe output if you need - and _ instead of + and /, with no padding.

What is URL-safe Base64?

A variant that uses - and _ instead of + and /, and usually drops the = padding, so the result can sit in a URL without escaping. Tick URL-safe output when encoding. Decode accepts both forms, with or without padding.

Why does Base64 decode say it is not valid?

The input has a character outside A-Z, a-z, 0-9, +, /, - and _, or it has one stray character at the end. A data: prefix, a = in the middle or a truncated copy are the usual causes. Remove them and decode again.

Can I decode a Base64 image or file here?

No. This page decodes to text only. If the decoded bytes are not UTF-8 text, as with an image or other binary file, it says so instead of showing garbled characters. It works for text such as JSON or the header and payload of a token.

Is my Base64 text uploaded when I decode it?

No. Encoding and decoding run in your browser, and nothing you paste is sent to a server. A share link keeps your input after the # in the address, which browsers do not send. It is free, with no sign-up and no ads.

About this tool

Works on text, including accents and emoji. Decoding accepts both standard and URL-safe Base64, with or without padding.

Format Code Now: free, no ads, no accounts. Your input stays in your browser.