Start with a known-good value
Paste SGVsbG8= into the text decoder. If Hello appears, the basic conversion works. Test the failing value separately. A rejected Zg= is a syntax error; /w== has valid Base64 syntax but its restored FF byte is not valid UTF-8. These failures need different fixes.
Choose text decoding or file decoding
For text, select the original character encoding. For an image, PDF or other binary file, save the Base64 value in a text file and use File decoding. The text output is not a file preview. Our synthetic fixture below deliberately includes 00 and FF to detect accidental text conversions that would damage binary data.
Check what happened before the decoder
Copy only the value from JSON, without quotes. The text decoder needs the portion after the comma in a data URL; File decoding also accepts a complete Base64 data URL. Percent escapes belong to URL decoding. A truncated payload cannot be recovered merely by adding padding. Follow the URL transport guide when a value works locally but fails after transmission.
Verified experiments
| Input / operation | Expected result | Browser result |
|---|---|---|
SGVsbG8= | Hello | Not run |
Zg=Base64 → UTF-8 | Error (expected rejection) | Not run |
ABase64 → UTF-8 | Error (expected rejection) | Not run |
/w==Base64 → UTF-8 | Error (expected rejection) | Not run |
00 ff 01 80Base64 → bytes | AP8BgA== → 00 ff 01 80 | Not run |
00 ff 01 80SHA-256 | edc81f7e4ee358fb91e94bd9bd74079c3dcba36f40f2c8a36e7ae0567afecc8f | Not run |
What the results mean
The FF byte is valid binary data but invalid UTF-8. A text conversion error does not mean the file is corrupt. The four-byte fixture restores exactly and has the same SHA-256 before and after conversion.
How to reproduce
Run the table, then decode SGVsbG8= in the text tool as a control. Save AP8BgA== as a .txt file and use File decoding to restore four bytes. Compare bytes or SHA-256 instead of renaming a file and assuming success.
Verification method
These fixed, public fixtures run against the same file codec and character codecs used by the converter. The JavaScript cases additionally check browser-native btoa, TextEncoder, URLSearchParams and SHA-256. Expected outputs are published before any script runs; the button shows actual results in your browser. No input is uploaded.
JavaScript · guide-cases.js · JavaScript · file-codec.js
Scope and limitations
Checked on 2026-10-21. This is a correctness check with small fixtures and one 100,000-character case, not a speed benchmark or a guarantee for every file. The four-byte file is synthetic binary data, not a PNG or PDF. SHA-256 equality checks byte preservation; it does not establish that a file is safe to open. Results can depend on browser support.
References
Choose a guide for your problem
Base64 encoding Korean text and emoji with UTF-8
Compare identical text encoded as different bytes. Select a character encoding from knowledge of the source, not from the language of the website.
Base64 vs Base64URL: differences, padding and decoding examples
Follow a Base64 value through a query string. This guide isolates transport damage from errors in the original value.
Base64 padding explained: what = and == mean
Work out padding from byte groups and check malformed endings. Character encoding and URL transport are covered separately.
JavaScript Base64 with Unicode: fix btoa() errors using UTF-8
Implement Unicode conversion in JavaScript and inspect cases where a successful btoa call still gives the wrong byte encoding.