πŸ› οΈ Developer Β· Updated November 21, 2026 Β· 4 min read

How to Decode a Base64 String

SGVsbG8= Hello πŸ”€

Base64 turns arbitrary binary data into a string of safe, printable characters, and you will meet it everywhere: data URIs, JSON Web Tokens, email attachments, and API payloads. Decoding it reverses the process to recover the original bytes or text. Developers decode Base64 constantly to inspect a token, read an encoded config value, or extract an embedded image. This guide explains what Base64 is, how to decode a string in your browser, and a crucial honesty point: Base64 is encoding, not encryption, so it hides nothing and secures nothing. Everything runs locally on grabcast.click, so the strings you paste are never uploaded. It is free and needs no login.

πŸ”€ Try the Base64 tool now β€” freeOpen β†’
Output box showing the decoded text Hello, GrabCast! Order #4521 shipped. with a Copy button
Read the decoded text, then copy the result.
πŸ’‘ Why Base64 exists

Many systems were built to handle text, not raw binary, and binary bytes can include control characters that break protocols or get corrupted in transit. Base64 solves this by mapping every three bytes onto four printable ASCII characters drawn from a 64-symbol alphabet. That lets you embed an image directly in HTML, put a signature inside a JSON token, or attach a file to an email that only carries text safely. The cost is size: Base64 output is about a third larger than the original. Decoding simply reverses the mapping to get the bytes back. Understanding this tradeoff explains when Base64 is the right tool and when it is just overhead.

How Base64 encoding works

Base64 is a fixed, reversible mapping between binary and text. There is no key and no secret involved.

Base64 is not encryption

This is the most important thing to understand, because treating Base64 as security leads to leaked secrets. It only changes the representation of data.

Decoding safely and correctly

Decoding is straightforward, but a few details determine whether you get clean output. Watch for these.

Common Base64 decoding errors and fixes

When a decode fails or returns nonsense, the string is usually damaged rather than the method being wrong. Check these causes in order.

If you need to go the other direction, encoding a string to Base64 with UTF-8 and padding covers the same details from the encoder side.

Where decoded Base64 appears in practice

Seeing real examples makes the format easier to recognise. HTTP Basic authentication sends a username and password joined by a colon and encoded, so the header looks opaque but decodes to plain text. Data URIs embed small images directly in HTML and CSS, and decoding the part after the comma gives you the image bytes. Email attachments travel as Base64 blocks inside the message, and API responses often wrap files or certificates the same way.

In each case, decoding is a debugging aid, not a security step. Pair it with a JWT decoder when the string has two dots, because tokens use a URL-safe variant of the same idea.

Step-by-step

1234
1Open the Base64 tool and paste the encoded string into the input field.
Base64 tool Text tab with the encoded string SGVsbG8sIEdyYWJDYXN0ISBPcmRlciAjNDUyMSBzaGlwcGVkLg== pasted into the input box
Paste the encoded string into the input field.
2Select decode mode so the tool converts from Base64 back to the original data.
Decode button pressed on the Base64 tool, converting from Base64 back to the original text
Select decode so the tool converts from Base64 back to the original data.
3Read the decoded text, or note that binary input produces raw bytes rather than readable characters.
Output box showing the decoded text Hello, GrabCast! Order #4521 shipped. with a Copy button
Read the decoded text, then copy the result.
4Copy the result, and if it looks garbled, check for a URL-safe variant or missing padding.
URL-safe token eyJjaXR5IjoiWsO8cmljaCIsInEiOiJhPmI_Y35kIn0= with an underscore decoded into JSON showing the city ZΓΌrich in the output box
If output looks garbled, check for a URL-safe variant (dashes and underscores) or missing padding.

Common mistakes to avoid

⚠️Treating Base64 as encryption and storing secrets in it, when anyone can decode it instantly.
⚠️Forgetting the trailing equals-sign padding, which can make some decoders reject the string.
⚠️Mixing standard and URL-safe variants, so plus and slash versus hyphen and underscore do not match.
⚠️Expecting readable text when the decoded data is actually binary, such as an image.

Pro tips

βœ“Use Base64 to transport binary as text, never to protect it, since it offers no confidentiality.
βœ“Check whether a token uses URL-safe Base64 before decoding, especially inside JWTs.
βœ“Remember decoded output can be binary, so treat unexpected characters as a file, not text.
βœ“Keep in mind Base64 adds about a third to the size, so avoid it when raw bytes are fine.
βœ“Encode with the same tool to verify a string round-trips back to what you expect.
βœ“Decode a small sample first when the string is huge, to confirm the format before processing everything.

Frequently asked questions

Is Base64 a form of encryption?

No. It is a reversible encoding with no key, so anyone can decode it. Use real encryption to protect sensitive data.

What are the equals signs at the end?

They are padding added when the input length is not a multiple of three bytes. They keep the output length a multiple of four.

Is my string sent to a server?

No. Decoding happens in your browser on grabcast.click, so the strings you paste never leave your device.

Why is my decoded text garbled?

The input may not be valid Base64, may be missing padding, or may use the URL-safe variant with hyphen and underscore.

Why is Base64 larger than the original?

It maps every three bytes to four characters, so the output is about one third bigger than the input.

πŸ“Œ Bottom line

Base64 is a reversible way to represent binary data as safe, printable text, which is why it shows up in tokens, data URIs, and email attachments. Decoding just reverses that mapping, and the essential point is that Base64 is encoding, not encryption, so it protects nothing on its own. The Base64 tool on grabcast.click encodes and decodes entirely in your browser, with no upload, no account, and no cost, so you can inspect and convert strings quickly and privately.

Open the Base64 tool β†’

Related guides

Browse more: all text and developer guides Β· the Base64 tool