Base64 Encoder / Decoder
Encode text or files to Base64, decode Base64 back to text, or preview Base64-encoded images. All client-side.
What is Base64 Encoding?
Base64 is a data encoding scheme that translates binary data (such as images, documents, or raw device buffers) into a string of 64 printable ASCII characters. The primary purpose of Base64 is to ensure that data remains intact without modification during transport across text-based protocols (like HTTP or SMTP email formats).
While it looks like encryption to the untrained eye, Base64 is not encryption — it is simply a translation format. Anyone with a Base64 decoder can immediately read the original data. Because 3 bytes of binary data are represented by 4 characters in Base64, encoding a file generallyincreases its size by about 33%.
Standard vs. URL-Safe Base64
| Type | Alphabet & Padding | Primary Use Cases |
|---|---|---|
| Standard Base64 | Uses + and /, padded with = | Email attachments (MIME), embedding images in HTML/CSS via data URIs, basic text encoding. |
| URL-Safe Base64 | Replaces + with -, / with _. Strips =. | JSON Web Tokens (JWTs), passing encoded data cleanly in strict URL paths or querystrings. |
Common Developer Scenarios
Inline Image Previews
Converting smaller SVGs or tracking pixels into a Base64 string allows you to embed them directly via CSS url(data:...) or HTML <img src="">, preventing secondary HTTP requests to external image CDNs.
API Token Generation
Basic Authentication credentials over HTTP require combining a username and password with a colon, then passing them as a Base64 string within the Authorization header request.
Payload Masking
While strictly not secure for hiding secrets, developers often Base64 encode lengthy, difficult-to-format JSON configuration objects before piping them into command line variables to avoid quote-escaping headaches.
Frequently Asked Questions
How can I see what an image looks like from Base64?
Simply paste your Base64 image payload (e.g., iVBORw0KGgo...) into the decoder box. Our engine automatically looks for file signatures and will instantly render an interactive image preview that you can view or download.
What is the size limit for this tool?
Because our tool runs 100% locally in your browser memory and utilizes Web Workers to heavily offload mathematical workloads from the main UI thread, you can smoothly encode files of 100MB+ without locking up your browser tab.
Is this tool safe for sensitive payloads?
Yes. We never track, record, or upload your data. Every piece of encoding, decoding, and parsing occurs securely inside the client-side JavaScript sandbox executed by your local machine.
About Base64 Encoder / Decoder
Base64 represents arbitrary bytes as a string of 64 printable ASCII characters. It exists because some channels — email headers, JSON values, URL parameters — do not tolerate raw binary. Encoding turns three bytes into four characters, so the output is always about a third larger than the input. This tool encodes and decodes text or files, supports both standard and URL-safe alphabets, and handles Unicode correctly via UTF-8.
What this tool does
- Encode text — UTF-8 strings to Base64 or Base64URL.
- Decode text — Base64 or Base64URL back to UTF-8, with auto-detection.
- Encode files — drag-drop binary files; output is the full Base64 string.
- Decode to file — paste a Base64 blob and download the recovered bytes.
- Auto-detect — handles missing padding and either alphabet automatically.
When you actually need it
Common cases: embedding small images as data: URIs in CSS, transporting binary blobs inside JSON (private keys, certificates, attachments), producing the body and signature segments of a JWT, encoding HTTP Basic Auth credentials, and storing binary data in environments that only allow ASCII (some config systems). For URL parameters, use Base64URL — standard Base64 contains + and / which need percent-encoding. For very large files, prefer multipart upload over Base64 — the 33% size overhead matters.
Pipeline
Base64 work commonly flows into:
- URL Encoder — wrap a Base64 string for use in a query parameter.
- Hash Generator — produce SHA digests of the original bytes.
- JWT Decoder — decode the segments of a JSON Web Token.
Privacy
All encoding and decoding runs in your browser. Files are read with FileReader and never uploaded. Read our privacy policy.
Frequently asked
- Is Base64 encryption?
- No. Base64 is encoding, not encryption. It is fully reversible without a key and offers zero confidentiality. Anyone who sees the string can decode it instantly. Use AES or another real cipher when you need secrecy.
- What is the difference between Base64 and Base64URL?
- Standard Base64 uses + and / as the last two characters and = for padding. Base64URL replaces + with - and / with _, and usually omits padding, so the result is safe to drop into URLs and JWTs without escaping.
- Can I encode binary files?
- Yes. Drop a file onto the tool and it will read the bytes via FileReader and produce a Base64 string. Works for images, PDFs, archives, anything. The decoder reverses the process and lets you download the recovered file.