Base64 encode or decode
Turn any file into Base64 text, or turn a Base64 file back into the bytes it came from.
or drop it here · files stay on your device
We count formats and sizes. Filenames stay private unless you opt in.
Downloads a small public example. Your own files are not used.
- Runs on your device
- No sign-up or watermark
- No fixed file size cap
The short answer
To encode or decode Base64 without a website seeing your data, choose a file here and pick Encode or Decode. The conversion runs in your browser with its built-in Base64 functions, so the file is never uploaded. Encoding accepts any file type; decoding expects a text file holding standard Base64.
A worked example
See a real input and result
This synthetic sample produced 1 output file from 1 input file. These are synthetic demonstration files, not someone’s documents.
Input sample
- input-1-t.txt13 B
Actual output
- Input count
- 1
- Output count
- 1
- Input
- 13 bytes
- Encoded
- 20 characters
- Input bytes
- 13
- Downloadable output bytes
- 20
Settings used: mode: encode · wrap: false
This synthetic sample only; results depend on the input.
Ran through this tool on . Use “Try sample files” above to run it yourself.
How to encode or decode Base64 offline
- STEP 1
Choose the file
Drop any file to encode it, or a .txt file containing Base64 to decode it. It is read on your device.
- STEP 2
Set the direction
Pick Encode to Base64 or Decode from Base64 in the Direction menu.
- STEP 3
Wrap long lines if needed
Turn on Wrap at 76 characters when encoding for email (MIME) or PEM-style output that expects short lines.
- STEP 4
Copy or save the result
Encoded text appears in the preview with a Copy button. Decoded bytes download as a .bin file you can rename.
What Base64 is, and why it is not encryption
Base64 writes binary data using 64 safe characters (A to Z, a to z, 0 to 9, plus and slash), with = as padding. Every three bytes become four characters, so encoded output is about a third larger than the original. It exists so binary data can travel through systems built for text: email attachments, data URIs, JSON fields and configuration files.
It is an encoding, not a cipher. Anyone can decode it, which is exactly why pasting a Base64 blob from a config file or an API response into an online decoder is a risk: the decoded content is often a key, a certificate or a customer record.
What survives, and what does not
Encoding reads the file as raw bytes and passes them through the browser’s btoa function in 32 KB chunks, so images, PDFs and archives work as well as text. Decoding reads your file as text, strips every space and line break, then runs atob and writes the resulting bytes to a .bin file. The report shows the byte count going in and the character count coming out.
What you keep
Every byte of the original file, in either direction
Binary files such as images, PDFs and ZIPs when encoding
Base64 that has been wrapped across many lines, since whitespace is stripped before decoding
What you lose
The original file name and type: decoded output is always saved as .bin, so rename it to the right extension
Base64URL (the variant with - and _ used in JWTs) is not accepted by the decoder
A data: URI prefix such as data:image/png;base64, must be removed before decoding
There is no text box to paste into yet; the input has to be a file
Honest limits are published on every tool page. If a tool cannot do something well, it says so here rather than letting you find out after the download.
Base64 encode or decode at a glance
| Input | Any file to encode; a text file of Base64 to decode |
|---|---|
| Output | TXT (encoded) or BIN (decoded bytes) |
| Alphabet | Standard Base64 (RFC 4648), not Base64URL |
| Batch | One file at a time |
| Runs on | Your device, in the browser |
| Works offline | After the first use |
If something goes wrong
It says "That is not valid Base64"
Check for a data: prefix, a header line such as -----BEGIN CERTIFICATE-----, or - and _ characters from Base64URL. Remove the prefix or header, or swap - for + and _ for /, then try again.
The decoded file will not open
The output is saved as .bin because Base64 carries no file type. Rename it with the extension the data really is, such as .png or .pdf.
Base64 encode or decode questions
Is it safe to decode Base64 online?
Only if the decoder does not send your text anywhere. This one runs atob in your browser and has no upload step. You can confirm it by opening the Network tab in DevTools while you decode.
How do I decode a Base64 string to a file?
Save the Base64 text in a .txt file, choose Decode from Base64 and run it. The bytes download as a .bin file; rename it to the real extension, for example image.png.
Why is Base64 bigger than the original file?
Each group of three bytes becomes four characters, so output grows by roughly 33 percent. Turning on 76-character wrapping adds a line break per line on top of that.
Can I encode an image to Base64 for a data URI?
Yes. Encode the image, then put data:image/png;base64, (or the matching type) in front of the text. The tool does not add that prefix for you.
Does it decode Base64URL from a JWT?
Not directly; the decoder only accepts the standard alphabet. For tokens, use the Decode a JWT tool, which handles the URL-safe alphabet and shows the claims.
Is there a file size limit?
No fixed limit. The whole file and its encoded copy are held in memory, so your device memory is the ceiling.