Example: the tool is already working on a sample input. Replace it with your own and press the button.

Decoded by GeneratePlus ✓

UTF-8 text · bytes: 27

Decode base64 to text

Paste a base64 string and press decode. The decoder accepts the standard alphabet (+ and /) and the URL-safe one (- and _), with or without = padding. Line breaks, spaces and a data:…;base64, prefix are ignored. If the decoded bytes are UTF-8 text, you see the text; otherwise you see the bytes in hexadecimal.

How base64 decoding works

Base64 writes every 3 bytes as 4 characters from an alphabet of 64: A–Z, a–z, 0–9 and two more. Decoding reverses this. Each character stands for 6 bits, four characters give back three bytes, and the padding = at the end tells how many bytes the last group holds.

Examples

  • SGVsbG8= decodes to Hello.
  • w6TDtsO8 decodes to äöü: three characters, six bytes of UTF-8.
  • AAEC/w== is binary data, the four bytes 00 01 02 ff.

Text or binary?

Base64 can carry anything: text, an image, a key, a compressed file. When the decoded bytes are valid UTF-8 without control characters, the decoder shows them as text. Anything else, such as a PNG image or a random key, is shown as hexadecimal bytes, so that nothing invisible ends up in your clipboard.

Why a string does not decode

Usually the input contains a character from outside the alphabet – a quote, a backslash, or a percent sign left over from URL encoding – or it was cut off: no valid base64 string has a length of 4n+1 characters. The decoder names the first problem it finds. Remember that base64 is an encoding, not encryption: anyone can decode it.

To go the other way, use the base64 encoder. A value of the form xxxxx.yyyyy.zzzzz is usually a JSON Web Token; the JWT decoder splits it and formats its header and payload.

Base64, URL and JWT tools

Frequently asked questions

How do I decode a base64 string?
Paste the string into the field and press Decode. Line breaks, spaces and a data URI prefix are ignored, and padding may be missing.
Why does the result appear as hex instead of text?
The decoded bytes are not UTF-8 text, for example an image, a compressed file or a random key. Showing them as hexadecimal bytes keeps invisible characters out of the clipboard.
Does the decoder handle URL-safe base64?
Yes. The alphabet with - and _ (base64url) is accepted just like the standard one with + and /, with or without = padding.