How do you spot Base64?

Base64 is text made only of letters, digits, + and /, often with one or two = signs at the end, such as R2FyZGVuIHBhcnR5IQ==. It looks like random letters, but it's data written so it can travel as plain text, and you'll meet it in emails, web pages, configuration files and API responses. A few beginnings give away what's inside: Base64 that starts with eyJ usually holds JSON, iVBORw0KGgo a PNG image and /9j/ a JPEG photo.

Tool description

Paste Base64 into the Encoded box, and the text appears in the Decoded box as you type, ready to copy. Spaces and line breaks in the Base64 are ignored, so Base64 split over several lines decodes in one go, and the = padding at the end is optional. The bytes are read as UTF-8 text, so letters of any language and emoji come back as they were.

To turn text into Base64, press the swap button between the boxes, which also moves the result into the input, or use the Base64 Encoder.

Features

  • Decodes Base64 to text as you type
  • Reads Base64 with spaces, line breaks or no = padding
  • Tells broken Base64 apart from Base64 that doesn't hold text
  • Runs in your browser

Examples

Encoded Decoded
R2FyZGVuIHBhcnR5IQ== Garden party!
QmFrZXJ5IG9wZW5zIGF0IDg= Bakery opens at 8
TGVtb25hZGU Lemonade
8J+OgiBIYXBweSBiaXJ0aGRheSE= 🎂 Happy birthday!
eyJuYW1lIjoiU3VubnkgR2FyZGVuIn0= {"name":"Sunny Garden"}

Fixing errors

  • "This isn't valid Base64" means the input has a character Base64 doesn't use, or an = before the end. Quotes or other text copied along with the Base64 cause it, and so does URL-safe Base64, which writes - and _ in place of + and /. Swap those two back: THVuY2g_ gives the error, while THVuY2g/ decodes to Lunch?.
  • A data URL gives the same error. Delete everything up to and including the comma: from data:text/plain;base64,VGVhIHRpbWU=, keep VGVhIHRpbWU=, which decodes to Tea time.
  • "This Base64 doesn't contain UTF-8 text" means the Base64 is fine, but its bytes aren't text. It may be a file, such as an image: use the Base64 to File Converter to get the file back.
  • Text saved in an older encoding, such as Latin-1, gives the same error when it has letters like é. Y2Fm6Q== is café in Latin-1, while the UTF-8 Base64 of café is Y2Fmw6k=.

Good to know

  • Base64 that was cut short often decodes without an error, just to less text: R2FyZGVuIHBhcnR5 gives Garden party, without the !. If the end looks wrong, check that you copied all of it.
  • If the result looks like Base64 again, the text was encoded twice: VkdWaElIUnBiV1U9 decodes to VGVhIHRpbWU=. Copy the result into the input to decode it once more, which gives Tea time.
  • Base64 isn't encryption: anyone who has the Base64 can read what it holds.