Three bytes
- Input
- foo
- Expected output
- Zm9v
3 bytes become 4 characters, no padding.
convert file to base64
On the File to Base64 tab, drop the file and choose the format and the line wrapping. The result appears in moments, with the text size, the percentage increase and buttons to copy and download.
3 bytes become 4 characters, no padding.
One byte takes two equals signs.
Two bytes take one equals sign.
The same data in both variants, the second without padding.
The prefix adds 23 characters.
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.
Only two characters of the alphabet: base64url uses - and _ in place of + and /. RFC 4648 asks that it not be called just base64, and allows omitting the padding when the length is known from context.
You can, up to 300 MiB. Reading is streamed, so the page stays responsive, but the resulting text is about 267 MB and can only be downloaded, not copied.
No. Encoding happens in the browser, reading the local file as a stream.
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.