Loading tool...

How to Decode Base64 to a String

You have a Base64 value from a log line, an API response or a config file and want to know what string is inside. Paste it below and read it, the same way your code would after decoding it.

Step 1

Paste the Base64 value

Paste the string into the input panel. It can be plain or URL-safe Base64, split over several lines, still wrapped in the quotes you copied it with, or a data: URI. The Sample button loads a short encoded status message.

•
From JSON or code: leave the quotes on if you like, "SGVsbG8=" works as well as SGVsbG8=.
•
From a JWT: paste only the middle part between the two dots. URL-safe - and _ without padding are fine.
•
From a terminal: output of base64 split into 76-character lines can be pasted as it is.
Step 2

Read the decoded string

A moment after you stop typing, the string appears in the output panel, read as UTF-8 and left exactly as it was encoded. A stray character is pointed out by line and column, and a value that was cut off while copying is called out as such.

•
UTF-8, not byte-by-byte: Sm9zw6kg8J+YgA== shows as José 😀, not the José you get from a bare atob().
•
Nothing is rewritten: values like 8901240544102066246, 00501 or 14.50 and every space and line break stay as encoded.
•
Not text after all: an image, PDF or archive gets a message instead of garbage. Base64 to File saves those.
Step 3

Copy or download it

Copy puts the decoded string on your clipboard, and Download saves it as decoded-text.txt in UTF-8. Both always use what is in the input right now.

•
Decoded JSON: if the string is a JSON document, paste it into JSON to Table to look through it.
•
Going the other way: String to Base64 encodes text back into a single Base64 line.

What is Base64 to String Decoding?

Base64 writes any bytes using only letters, digits, + and /. Decoding reverses that and gives you the bytes back. To turn those bytes into a string you also need the character encoding, and for almost everything on the web that is UTF-8.

This page does both steps and shows the result without touching it. It does not check what the string means: a JWT payload is shown, not verified, and decoded JSON is shown as text, not reformatted.

Frequently Asked Questions

Where do Base64 strings usually turn up in code?

In places that only accept one safe line of text. API responses often carry a file name, a token or a nested JSON document as a Base64 field. Environment variables and CI secrets hold certificates and config that way, Kubernetes Secrets store every value in Base64, and HTTP Basic auth sends user:password as Base64. Paste the value here to see the string your code will get after decoding it, for example with atob() plus TextDecoder in JavaScript, base64.b64decode(...).decode('utf-8') in Python or Convert.FromBase64String in C#.

Can I read the payload of a JWT with this?

Yes, one part at a time. A JWT is three Base64url parts joined by dots: header, payload and signature. Copy the middle part (between the two dots) and paste it here. Base64url uses - and _ and usually drops the = padding, and both are accepted. You get the JSON claims as text, such as sub, exp and the user ID. Decoding does not check the signature, so it tells you what the token says, not whether it is genuine.

How do the decoded bytes become characters?

Base64 only stores bytes. The page turns the text back into those bytes and reads them as UTF-8, which is what nearly every API, browser and modern language uses for strings. That is why Sm9zw6kg8J+YgA== comes out as José 😀: the é is two bytes and the emoji is four. A plain atob() call skips this step and shows mojibake such as José. If the bytes are not valid UTF-8, they are read as Windows-1252 instead and a note says so.

Will numbers and spacing come back exactly?

Yes. Nothing is parsed, trimmed or reformatted after decoding. A long ID like 8901240544102066246, a zip code like 00501, a price written 14.50, Windows line endings and leading or trailing spaces all appear exactly as they were encoded, in the output, in Copy and in the .txt download.

It says the data is not a text string. Why?

The Base64 decoded fine, but the bytes are a file rather than text: a PNG or JPEG image, a PDF, a ZIP or gzip archive, or other binary data. Showing those as a string would only give garbage characters. Base64 to File saves the decoded bytes as a real file instead.

Is Base64 a way to hide a secret, and is my string sent anywhere?

Base64 is an encoding, not encryption. Anyone who has the string can decode it in a second, exactly as this page does, so an API key or password in Base64 is still in plain sight. The decoding itself runs in your browser: nothing you paste is uploaded or kept, and a reload starts with an empty editor.

Related pages: String to Base64 · Base64 to File · Base64 Decode