🔓

Base64 Decoder

✓ Free & no signup 🔒 Runs 100% in your browser Updated 2026-11-25 Other Tools

You find a Base64 string in a JWT, a log line, an email header, or a config file, and you need to know what it says. This tool decodes it on the spot, entirely in your browser: paste the string, and the decoded text appears live as you type. There is no server round trip, no upload, and no stored history — the input never leaves your device, which matters when the string is a session token, a credential, or customer data.

Decoding is where most Base64 tools fall apart, because real-world input is messy. Strings arrive from email clients that hard-wrap lines every 76 characters, from JWTs that dropped the padding, from URL parameters where plus signs became spaces, and from systems that emit the URL-safe alphabet with minus and underscore instead of plus and slash. This page accepts all of those variants: it tolerates whitespace anywhere in the input, fixes missing equals-sign padding automatically, and understands both the standard and URL-safe character sets, so the paste button works instead of throwing an error at the first obstacle.

The output side gets equal care. Results are decoded as UTF-8, so emoji, Chinese characters, and accented letters emerge correctly instead of as mojibake, and a small stats line reports the decoded size in both characters and bytes — useful when the decoded payload is destined for something size-limited, like an HTTP header.

How Decoding Works Under the Hood

Decoding reverses the encoding arithmetic. Each character of the input maps back to a value from 0 to 63 — A is 0, B is 1, through Z at 25, then a through z at 26 to 51, digits 0 through 9 at 52 to 61, plus sign at 62, and forward slash at 63. Four characters therefore carry 24 bits of data, which regroup into 3 bytes. A worked example: the string TWFu decodes to the word Man. T is 19, W is 22, F is 5, and u is 46; in 6-bit binary that is 010011, 010110, 000101, 101110, reassembled into bytes 01001101, 01100001, 01101110 — decimal 77, 97, 110, exactly the UTF-8 bytes of the letters M, a, and n.

Padding behaves symmetrically. When the original data had 1 leftover byte, the encoder produced two data characters followed by two equals signs, and the decoder recovers 1 byte from them; 2 leftover bytes produce three characters and one equals sign, recovering 2 bytes. This is why the padding fixes matter so much in practice: a truncated copy that lost its trailing equals signs still contains all the data characters, and reconstructing the padding is just arithmetic on the string length — the tool appends one or two equals signs until the length divides by 4, then decodes normally.

How to Use This Tool (Step by Step)

  1. Paste the Base64 string into the input. Decoding happens live on every keystroke — no submit button.
  2. Do not bother cleaning the input first: line breaks, spaces, and tabs are stripped automatically, which rescues strings copied out of wrapped emails and multi-line log entries.
  3. Read the decoded output on the right. UTF-8 is assumed, so international text and emoji display as themselves.
  4. Check the stats line for character and byte counts of the result if the output has a size constraint downstream.
  5. If the string fails to decode, the error names the actual problem — an invalid character, usually — rather than silently producing garbage.

Common Decode Errors and What Causes Them

Most failed decodes trace back to one of a handful of causes, each with a telltale signature:

  • Invalid character in the middle of the string. Quotes, commas, colons, or Unicode lookalike characters picked up from surrounding prose when copying. The fix is trimming the paste to just the token — JSON often wraps values in quotes that ride along into the clipboard.
  • Length not a multiple of 4. The classic JWT symptom: standard libraries strip the equals padding. This tool re-pads automatically, but if you are debugging why another tool failed, this is the reason nine times out of ten.
  • Plus signs turned into spaces. This happens when a Base64 string traveled through a URL query parameter or an HTML form without proper encoding — the plus is the escaped form of a space. If the result looks almost right but breaks at random spots, search the input for spaces in place of plus signs and restore them.
  • Valid decode, gibberish output. The string decoded cleanly into bytes, but those bytes were never UTF-8 text. Decoding an image or a zip file this way produces symbol soup — binary content needs a binary tool, and the stats line showing byte counts without readable text is the giveaway.
  • Empty output. An empty input technically decodes to an empty string; it usually means the paste never landed or you selected the wrong clipboard entry.

Decoding Real-World Formats

Three formats account for most decoding sessions. First, JWT segments: a token shaped like header.payload.signature has three Base64URL pieces between dots. Paste the middle segment here to read the claims — the exp timestamp, the subject, the scopes. Remember the payload is signed, not encrypted; reading it is exactly what anyone with the token can do, which is why secrets must never be placed inside one. URL-safe characters and missing padding, both handled here, are the norm for JWTs.

Second, HTTP Basic authentication headers, which decode the Authorization value into username:password form — handy for debugging an API client, and simultaneously a reminder that Basic auth is only safe over HTTPS because the credentials are this trivially readable. Third, Data URIs and embedded payloads: the segment after base64, in strings like data:image/png;base64, contains binary data, not text. Decoding it as text yields noise; that job belongs to a file-oriented converter, though decoding a data:application/json or data:text/plain payload works fine here.

Standard Versus URL-Safe Input

PositionStandard alphabetURL-safe alphabet
Value 62plus signminus sign
Value 63forward slashunderscore
Paddingequals signs keptusually omitted
Typical sourceemail, classic toolingJWTs, web APIs, identifiers

This tool accepts either alphabet, and mixed input too — useful when a string has been hand-edited. The two alphabets encode identical bytes; only two characters differ, so detection is not even required. If a decoded result is plausible but contains odd substitutions, check whether the source system used the URL-safe variant and your copy step mixed conventions.

Tips and Best Practices

  • Trust but verify: after decoding something important, glance at the byte count — a payload claiming to be JSON but measuring a few hundred bytes may be an error page, not the data you expected.
  • Never decode a token you did not expect to receive; a Base64 blob in an unexpected email is a common phishing attachment trick, though decoding itself cannot execute anything.
  • For repeated work with the same long input, use the swap button to move the decoded output back into the input field and re-encode it — round-trip equality confirms the decode was faithful.
  • Remember the decode is local: passwords, tokens, and API keys in Base64 can be decoded here without transmitting them anywhere.
  • When sharing decoded findings in tickets, include the byte count alongside the text; it tells the next reader whether the payload was complete.

Frequently Asked Questions

How do I decode Base64 to plain text?
Paste the string into this tool's input field and the decoded text appears immediately — decoding runs live in your browser with every keystroke, and nothing is uploaded to any server. The tool handles the common real-world messes automatically: line breaks and spaces are stripped, missing equals-sign padding is repaired, and both the standard and URL-safe alphabets are accepted. Output is interpreted as UTF-8, so emoji, Chinese characters, and accented letters decode correctly rather than turning into mojibake, and a stats line shows the result's size in characters and bytes.
Why does my Base64 string fail to decode?
The most common causes, in order: an invalid character such as a quote, comma, or colon copied from surrounding text; a length that is not a multiple of 4, usually missing padding from a JWT segment; plus signs that became spaces during passage through a URL query parameter; and input that is valid Base64 of binary data rather than text, which decodes to gibberish. This tool fixes padding and whitespace automatically and reports invalid characters explicitly instead of silently emitting garbage, so the error message usually names the exact problem to look for.
How do I decode the payload of a JWT?
A JWT looks like three Base64 strings joined by dots: header.payload.signature. Copy the middle segment — between the first and second dots — and paste it here. JWTs use the URL-safe alphabet, where minus replaces plus and underscore replaces slash, and they omit the trailing equals padding; this tool handles both automatically. The decoded payload shows the claims in JSON, including exp and sub fields. Remember the payload is signed, not encrypted: anyone holding the token can read it exactly this easily, so never put secrets in one.
Is decoding Base64 the same as decrypting it?
No, and the distinction is fundamental. Base64 is a public encoding scheme with no key: decoding is a fixed character mapping that anyone and any tool can perform, instantly. Decryption requires a secret key that was used to scramble the data in the first place. If a string can be Base64-decoded, it was never protected — which is why passwords should never be stored as Base64, and why HTTP Basic authentication is considered readable-by-design and only acceptable over HTTPS. Encoding makes binary data text-safe; it provides zero confidentiality.
Can this tool decode a Base64 image?
Not meaningfully. This page decodes to UTF-8 text, and an image's bytes are binary data that renders as nonsense symbols when forced through a text decoder. The correct route is a dedicated image tool: a Base64-to-image converter reads the data URI, reconstructs the actual binary file, and shows you the picture. A practical tell that you used the wrong tool: the decode reports a byte count in the stats line but the text area shows unrecognizable characters. JSON or plain text embedded in data URIs, on the other hand, decode cleanly here.
Does the decoder handle line breaks and extra spaces in the input?
Yes, automatically. Email systems traditionally hard-wrap Base64 at 76 characters per line, log files split tokens across lines, and manual copying often picks up stray spaces — all of which make strict decoders reject otherwise valid input. This tool strips whitespace of every kind before decoding, so a token pasted from a wrapped email decodes the same as a single-line paste. The only characters that actually matter are the 64 alphabet symbols and the equals padding, everything else is ignored rather than treated as an error.

Related Tools