Base64 Encode/Decode (Binary)
100% client-side processing (no server upload). Encode binary files/bytes to Base64 with format presets (RFC 4648, Base64url, MIME wrapping), padding control, strict validation, and batch multi-file support. Also supports decoding Base64 back to a downloadable file.
Features
- Upload or drag-and-drop binary files (multi-file batch supported)
- Two actions: encode file β Base64, or decode Base64 β file download
- Format presets: RFC 4648 (standard), RFC 4648 URL-safe (Base64url), RFC 2045 MIME (wrap 76 + CRLF)
- Padding control: Auto, Always include "=", or Omit padding
- Optional line wrapping length for encoded output (0 disables; MIME commonly uses 76)
- Strict validation mode to reject invalid characters/padding (useful for debugging)
- Optional final newline on Base64 output (encode mode)
- 100% client-side processing (no server upload).
How to use for base64-binary-encoder
Drop one or more files (or paste Base64 for decoding)
For encoding, drag-and-drop your binary file(s) into the upload area. For decoding, paste the Base64 string you received (for example from JSON, a log, or an email).
Choose the action/mode and run it
Select "Action": "Encode file β Base64" or "Decode Base64 β file", then click the matching Run button (Encode/Decode). If needed, pick a "Format" preset (standard/Base64url/MIME), adjust padding and wrapping, and enable "Strict validation" when debugging malformed Base64.
Copy the Base64 output or download the decoded file
After encoding, copy the Base64 text (optionally wrapped/newline-terminated based on your settings). After decoding, download the reconstructed binary file (file naming follows the tool's rules when possible).
Technical specifications
Execution Model
Runtime disclosure, constraints, and what happens to your data.
| Aspect | Detail |
|---|---|
| Mode | 100% client-side processing (no server upload). |
| Action scope | Encode binary β Base64 (primary), plus Decode Base64 β binary download |
| Inputs | Encode: File/Blob/Uint8Array/ArrayBuffer/TypedArray. Decode: Base64 string |
| Outputs | Encode: Base64 text. Decode: bytes as a downloadable file |
| Limits | ~1β2MB chars; ~25000 ms timeout |
| Retention | All processing happens locally in your browser (no upload) |
Mini Example
A tiny byte sequence encoded to Base64 (standard RFC 4648).
| Item | Value |
|---|---|
| Input bytes (hex) | 00 01 02 03 04 05 06 07 08 09 |
| Output Base64 | AAECAwQFBgcICQ== |
| When output differs | Base64url changes "+"/"/" to "-"/"_"; padding may be omitted; MIME may wrap lines |
Errors & Edge Cases
Common failure modes and what to do next.
| Symptom | Likely cause | What to check |
|---|---|---|
| Input must be a string for decode | You tried to decode but provided bytes/file instead of Base64 text | Set Action to "Encode" for files; for Decode, paste a Base64 string |
| This tool encodes binary data... not a text string | You tried to encode by pasting text into the binary encoder | Upload a file (or provide bytes) for Encode; use the text Base64 tool for pure text workflows |
| Invalid characters / strict validation failure | Base64 contains characters not allowed by the selected format, or bad padding | Confirm the "Format" (standard vs Base64url vs MIME) and "Padding"; disable Strict to accept lenient input |
| Length/padding errors (especially when Strict is on) | Truncated Base64, wrong "=" padding, or mixed alphabets | Re-copy the full payload; ensure you didn't lose trailing "=", or set Padding to "Auto" |
| Input too large (max 2MB) | Payload exceeds the tool's safety limit | Split the file/payload or use a local CLI/script for larger data |
| Adapter call timed out | Processing exceeded the ~25s timeout (size/device dependent) | Try smaller inputs, disable Live preview, or switch to local command-line tooling |
Command line alternatives
For large files, secrets, or CI usage, run Base64 encode/decode locally. Below are canonical, widely available options.
Linux/macOS (coreutils)
Encode a file to Base64 (no wrap)
base64 -w 0 input.bin > output.b64.txtEncodes input.bin to Base64. The -w 0 flag disables line wrapping (GNU coreutils).
Encode a file to MIME-style Base64 wrapping (76 chars/line)
base64 -w 76 input.bin > output.mime.b64.txtMatches the common MIME line length. (Line endings may differ from CRLF depending on platform.)
Decode Base64 back to a file
base64 -d input.b64.txt > output.binDecodes Base64 text into raw bytes.
macOS (BSD base64) / Unix
Encode a file to Base64
base64 < input.bin > output.b64.txtBSD base64 uses different flags than GNU; this form works broadly.
Decode Base64 back to a file
base64 -D < input.b64.txt > output.binOn macOS/BSD, decode is commonly -D (not -d).
OpenSSL (portable)
Encode a file to Base64 (single line)
openssl base64 -A -in input.bin -out output.b64.txtThe -A flag emits a single line (no wrapping).
Decode Base64 back to bytes
openssl base64 -d -in input.b64.txt -out output.binUseful when coreutils base64 isn't available.
Node.js
Encode a file to Base64
node -e "const fs=require('fs'); const b=fs.readFileSync('input.bin'); process.stdout.write(b.toString('base64'))" > output.b64.txtReads bytes and prints Base64.
Decode Base64 to a file
node -e "const fs=require('fs'); const s=fs.readFileSync('input.b64.txt','utf8').trim(); fs.writeFileSync('output.bin', Buffer.from(s,'base64'))"Decodes Base64 text to raw bytes.
Python
Encode a file to Base64
python -c "import base64,sys; sys.stdout.write(base64.b64encode(open('input.bin','rb').read()).decode('ascii'))" > output.b64.txtEncodes file bytes to Base64 ASCII.
Decode Base64 back to a file
python -c "import base64; open('output.bin','wb').write(base64.b64decode(open('input.b64.txt','rb').read()))"Decodes Base64 to raw bytes.
Use cases
Embed binary data into text channels
- Attach small binaries inside JSON payloads
- Paste a file into issue trackers or docs as Base64
- Transport bytes through systems that only accept text
Debug Base64 produced by another system
- Switch between standard/Base64url/MIME presets to match the producer
- Enable Strict validation to catch padding/alphabet mistakes
- Use decode to confirm the payload reconstructs the original file
Pipeline checks in CI for small artifacts
- Verify an artifact decodes without errors before publishing
- Normalize Base64 output (wrapping/padding) for stable diffs
Safer sharing of non-secret binary snippets
- Share reproducible test fixtures without emailing raw binaries
- Keep secrets out of the browser tool; use local CLI for keys/tokens
β Frequently Asked Questions
Is there a public API for this tool?
API endpoint.Is processing local or remote?
Base64 data is processed locally in your browser.Can I safely encode secrets (keys, tokens, passwords) here?
Why does decoding fail with "invalid characters" or "bad padding"?
Why can't I encode by pasting text directly?
Base64 encoder so the text-to-bytes encoding is explicit.Pro Tips
If you need URL-safe tokens, choose the Base64url preset; it replaces "+"/"/" with "-"/"_" and often omits padding depending on your settings.
When debugging a failing decode, enable Strict validation to get earlier, clearer failures, then relax it once you've identified the producer's quirks.
For stable diffs in CI, standardize wrapping and final newline so your Base64 outputs don't change between environments.
For large files or anything sensitive, prefer local CLI tooling; it avoids browser limits and reduces accidental leakage through clipboard or extensions.
Additional Resources
Other Tools
- CSS Beautifier
- HTML Beautifier
- Javascript Beautifier
- PHP Beautifier
- Color Picker
- Sprite Extractor
- Base32 Binary Encoder
- Base32 Decoder
- Base32 Encoder
- Base58 Binary Encoder
- Base58 Decoder
- Base58 Encoder
- Base62 Binary Encoder
- Base62 Decoder
- Base62 Encoder
- Base64 Decoder
- Base64 Encoder
- Hex Binary Encoder
- Hex Decoder
- Hex Encoder
- Csharp Formatter
- Csv Formatter
- Dockerfile Formatter
- Elm Formatter
- ENV Formatter
- Go Formatter
- Graphql Formatter
- Hcl Formatter
- INI Formatter
- JSON Formatter
- Latex Formatter
- Markdown Formatter
- Objectivec Formatter
- Php Formatter
- Proto Formatter
- Python Formatter
- Ruby Formatter
- Rust Formatter
- Scala Formatter
- Shell Script Formatter
- SQL Formatter
- SVG Formatter
- Swift Formatter
- TOML Formatter
- Typescript Formatter
- XML Formatter
- YAML Formatter
- Yarn Formatter
- CSS Minifier
- Html Minifier
- Javascript Minifier
- JSON Minifier
- XML Minifier
- Http Headers Viewer
- PDF To Text
- Regex Tester
- Serp Rank Checker
- Whois Lookup