Base64 text
- Input
- data:text/plain;base64,SGVsbG8=
- Expected output
- Hello (text/plain)
SGVsbG8= decodes to 5 bytes.
convert data uri to file
Paste the whole data URI, starting at data:. The tool splits the header from the data, decodes, compares the declared type with the one detected in the bytes and shows a preview of the image, text or PDF.
SGVsbG8= decodes to 5 bytes.
With no declared MIME, the type comes from the bytes.
%C3%A1 is á in UTF-8.
The bytes are a PDF, despite the declared image/jpeg.
89 50 4E 47 0D 0A 1A 0A; on its own it does not form a complete image.
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.
RFC 2397 does not set a maximum, but browsers, servers and proxies limit URL and header sizes. This tool accepts texts of up to 200 MiB, processed in chunks.
Yes, copy just the part from data: up to the last character before the closing quote or parenthesis and paste it into the field. If a parenthesis or quote is left over, the tool points to the exact position.
No. The SVG appears only inside an image tag, which blocks scripts, and its source is never inserted into the page.
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.