Base64 Encode/Decode (Text)
Input
Output
Why Use This Base64 Decoder
- Real-time decoding preview for text-based payloads
- Support for multi-line Base64 blocks, PEM-style sections and data URIs
- URL-safe Base64 support (-/_ variants) with automatic normalization
- Friendly for email attachments and MIME blocks (Content-Transfer-Encoding: base64)
- Handles binary payloads โ download the decoded result as a file
- Mobile-friendly interface for quick checks on the go
- Decoding happens in your browser โ Base64 content is not sent to a remote server
๐ง How Base64 Decoding Works (Step-by-Step) for base64-decoder
Paste or drop Base64 data
Paste your Base64 string into the input area, or drop a text file containing Base64 data. The tool can also detect and extract the payload from data:*;base64,... URLs.
Normalize and validate
The decoder trims whitespace, handles URL-safe characters (- and _), and checks that the string only uses valid Base64 characters plus optional padding =.
Decode Base64 blocks
Every 4 Base64 characters are mapped to 24 bits, regrouped into 3 original 8-bit bytes. Padding = tells the decoder how many bytes are in the final group.
Preview or download the result
If the decoded output is text, you see it directly in the output panel. For binary data (images, documents, archives, etc.), you can download the decoded result as a file.
Technical Specifications
Character Set & Variants
The decoder follows RFC 4648 for standard Base64 and also understands the URL-safe variant.
| Range / Type | Characters | Notes |
|---|---|---|
| Indices 0โ25 | AโZ | Uppercase letters |
| Indices 26โ51 | aโz | Lowercase letters |
| Indices 52โ61 | 0โ9 | Digits |
| Indices 62โ63 | + / | Standard Base64 symbols |
| Padding | = | Signals that the last quantum is incomplete |
| URL-safe | - _ | Common web-safe variant (re-mapped to + / before decoding) |
Size Relationship (Original vs Base64)
Base64 encoding increases size by roughly one third. When you decode, the data shrinks back to its original size.
| Original size | Base64 size (approx.) | Overhead |
|---|---|---|
| 3 bytes | 4 characters | ~33% larger |
| 1 KB | โ 1.37 KB | ~37% larger including padding and newlines |
| 1 MB | โ 1.37 MB | Same ratio at larger scales |
Performance & Practical Limits
Base64 decoding is lightweight, but browser memory still matters for very large payloads.
| Payload size | User experience | Recommendation |
|---|---|---|
| A few KB | Instant | Perfect for quick copies from DevTools or logs |
| 100 KB โ 1 MB | Still very responsive | Typical for API responses or small attachments |
| 1โ5 MB | Generally fine on modern machines | Use downloads for binary data |
| > 5โ10 MB | May feel slow or memory-heavy in the browser | Prefer CLI or language libraries |
Command-Line Base64 Decoding
For very large files or automated pipelines, use native Base64 tools in your environment.
Linux / ๐ macOS
Decode a Base64 string
echo 'SGVsbG8=' | base64 --decodeDecodes the inline string SGVsbG8= into Hello.
Decode a Base64 file
base64 -d input.b64 > output.binConverts a Base64 file back to raw binary data.
Windows / PowerShell
Decode with PowerShell
[Text.Encoding]::UTF8.GetString([Convert]::FromBase64String("SGVsbG8="))Decodes a Base64 string into UTF-8 text.
Decode with certutil (CMD)
certutil -decode input.b64 output.binUses built-in Windows tooling to decode a Base64 file.
Practical Applications
Web Development & APIs
Inspect and recover data from Base64 payloads in the browser.
- Decode images embedded as data URIs in HTML / CSS.
- Inspect Base64-encoded payloads in REST or GraphQL responses.
- Decode Base64 blobs stored in LocalStorage or IndexedDB.
const binary = atob(base64String);const json = JSON.parse(atob(encodedJson));Email & MIME Attachments
Work with Base64-encoded attachments and MIME parts.
- Decode Base64-encoded email attachments from EML files.
- Inspect MIME parts with Content-Transfer-Encoding: base64.
- Debug mailer libraries that embed inline images.
Content-Transfer-Encoding: base64const buffer = Buffer.from(encodedContent, 'base64');Security & Forensics
Understand what is actually hidden behind Base64 blobs.
- Decode suspicious Base64 blobs found in logs or payloads.
- Inspect obfuscated configuration values or script fragments.
- Combine with other tools to understand encoded IoCs.
// Node.js example: decode suspected payload
const decoded = Buffer.from(encoded, 'base64').toString('utf8');
console.log(decoded);
โ Frequently Asked Questions
โWhy does my decoded output look corrupted?
Base64 string contains invalid characters, (2) the padding = characters are missing or truncated, (3) the original data was binary (image, PDF, ZIP, etc.) but you are trying to view it as plain text. In that last case, download the decoded result as a file instead of displaying it directly.๐How do I handle URL-safe Base64?
Base64 replaces '+' with '-' and '/' with '_', and sometimes omits padding '='. This tool automatically normalizes those characters during decoding. If you implement it yourself, replace '-' โ '+', '_' โ '/', then pad with '=' until the length is a multiple of 4.๐Is Base64 a secure way to hide data?
Base64 is an encoding, not encryption. It is reversible by design and provides no confidentiality. If the decoded payload contains sensitive information, make sure proper encryption (for example AES or TLS in transit) is used in your system.๐What is the maximum size I can safely decode here?
Base64 blocks up to a few megabytes in most modern browsers. Larger payloads may work but can become slow or memory-intensive. For anything beyond ~5โ10 MB, itโs better to use command-line tools or server-side libraries.Pro Tips
If decoding fails, first strip out any headers (such as '-----BEGIN' / 'END-----' blocks) and retry with only the Base64 characters.
When you expect JSON, wrap the decode step in a try/catch with JSON.parse to fail fast if the payload is not what it claims to be.
For large binary payloads (images, archives), decode them directly to a file instead of trying to display them as text.
Additional Resources
Other Tools
- CSS Beautifier
- HTML Beautifier
- Javascript Beautifier
- PHP Beautifier
- Color Picker
- Sprite Extractor
- Base64 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