Invalid character
- Input
- Zm9v\nYm@r
- Expected output
- Erro na posição 8 (linha 2, coluna 3): @
The position counts from 1 and includes the line break.
invalid base64 string error
Paste the Base64 that failed. The tool applies the safe fixes by itself and, for whatever is left, lists each problem with its exact position and a snippet of the surrounding text, so you can see the error at a glance.
The position counts from 1 and includes the line break.
5 useful characters leave a remainder of 1; tolerant mode drops the last one.
Two Base64 strings glued together; split them and decode one at a time.
Fixed automatically, the = is added.
%2B is +, %2F is /, %3D is =; it becomes +/8=.
Paste the Base64 (with or without the data:application/pdf;base64, prefix) and check that the detected type is PDF. A PDF in Base64 starts with JVBERi, which is %PDF- encoded. The tool shows the PDF in the preview and downloads it with a .pdf extension. If the API response is JSON, paste the whole JSON: it finds the longest field that looks like Base64 and lets you switch fields.
Libraries differ in strictness: some ignore line breaks and missing padding, others reject them. The alphabet changes too, and + / are not accepted by strict URL-safe decoders. The tool shows which alphabet was detected.
It is the non-breaking space, common in text copied from web pages and e-mails. The tool treats it as whitespace and removes it without error; other invisible spaces, such as the zero-width one, are reported with their code.
No. It is for recovering data from a damaged text, and the result may be corrupted. Use it on text files and images to look at, not on documents you will sign or software you will install.
import base64
with open('file.bin.b64', 'r') as src, open('file.bin', 'wb') as dst:
dst.write(base64.b64decode(src.read()))import base64
with open('arquivo.pdf', 'rb') as src, open('arquivo.pdf.b64', 'w') as dst:
dst.write(base64.b64encode(src.read()).decode('ascii'))Everything is processed in your browser. Nothing is sent.