| # | Hex | Dec | Char | Copy |
|---|---|---|---|---|
| {{ b.i }} | {{ b.hex }} | {{ b.dec }} | {{ b.ch }} | |
| No bytes | ||||
Binary data is information stored as bytes that often needs to pass through text systems without confusion, and Base64 expresses those bytes as readable characters so the content survives intact.
The converter lets you move between your original text or file and its Base64 form, and it also reverses the process so you can check exact byte counts and see how padding and line wrapping affect the result.
You can view a concise preview of decoded bytes as characters and inspect a per‑byte table when needed, and you may also package Base64 as a self‑contained data string that embeds neatly in documents.
Results are shaped by the chosen text encoding and by whether padding is kept, so use consistent settings when you compare outputs across runs.
If a pasted block contains line breaks or headers from a message, enable the stripping option before decoding so characters outside the Base64 alphabet do not cause errors.
Treat sensitive material with care and prefer test samples in shared screenshots.
Binary data is the quantity of interest. Each input is interpreted as a sequence of 8‑bit bytes. Base64 represents those bytes with an alphabet of sixty‑four symbols and an optional trailing padding character that preserves alignment.
The computation maps every group of three input bytes to four output characters. Padding signals when the final group has one or two bytes. A URL‑safe variant replaces + and / with - and _. Wrapping inserts line breaks at fixed column widths without changing meaning.
Results are read as text or as raw bytes. When text is selected, bytes are decoded with one of four encodings: UTF‑8, UTF‑16LE, ISO‑8859‑1 (Latin‑1), or ASCII. Choosing the right encoding matters for accented letters and symbols.
Comparability improves when you keep the same alphabet choice, padding policy, and line endings across runs. Values near group boundaries change length when padding is toggled, which is expected.
| Symbol | Meaning | Unit/Datatype | Source |
|---|---|---|---|
| n | Number of input bytes | byte count | Input |
| L | Base64 length with padding | characters | Derived |
| L′ | Base64 length without padding | characters | Derived |
| p | Padding characters removed | 0 to 2 | Derived |
Input text “Hi” with ASCII produces two bytes: 72 and 105 (0x48, 0x69). Groups of three bytes become four Base64 characters, so two bytes yield four characters with one padding mark.
If padding is omitted, the visible result is “SGk”. Both forms decode to the same two bytes.
+// with -/_ for the URL‑safe variant if requested.= padding when the final block has one or two bytes, unless disabled.data:<mime>;base64, before the Base64 text.| Parameter | Meaning | Unit/Datatype | Typical Range | Sensitivity | Notes |
|---|---|---|---|---|---|
| Mode | Encode or decode | enum | encode, decode | High | Swapping feeds the current output back as input. |
| Text encoding | Byte mapping for input or output | enum | UTF‑8, UTF‑16LE, Latin‑1, ASCII | High | Controls how characters become bytes and back. |
| URL‑safe | Safe alphabet for links | boolean | off or on | Low | Decoding accepts either alphabet. |
| Padding | Include trailing = on encode |
boolean | off or on | Medium | Affects visible length only. |
| Fix missing padding | Auto‑add = to multiples of four |
boolean | off or on | Low | Useful for compact tokens. |
| Wrap preset | Column width for line breaks | integer | 0, 64, 76 or custom | Low | Wrapping is cosmetic. |
| Wrap columns | Custom wrap length | integer | 4 to large | Low | Enabled when preset is custom. |
| Strip non‑Base64 | Ignore characters outside the alphabet | boolean | off or on | Medium | Helps with pasted blocks. |
| Line endings | Newline style for wrapped output | enum | LF or CRLF | Low | Decoding ignores newlines. |
| Data string | Prefix with data:<mime>;base64, |
boolean + text | Enabled with MIME type | Low | Auto‑fills type when encoding a file. |
Units, precision, and rounding: Counts are integers. Bytes are 8‑bit units. Character counts include line breaks when wrapping is enabled. No numeric rounding is applied.
| Field | Type | Min | Max | Step/Pattern | Error Text | Placeholder |
|---|---|---|---|---|---|---|
| Wrap columns | number | 4 | — | step 1 | — | — |
| Base64 input (decode) | text | 0 | — | alphabet A–Z a–z 0–9 + / and = | “Found non‑Base64 characters. Enable “Strip non‑Base64” in Advanced to ignore them.” | Paste Base64… |
| File read (encode) | bytes | 0 | — | — | “Failed to read file bytes.” | — |
| File read (decode) | text | 0 | — | — | “Failed to read file text.” | — |
| Decoding | process | — | — | — | “Invalid Base64 content.” or “Decode failed.” | — |
| MIME type | text | — | — | free text | — | image/png |
| Input | Accepted Families | Output | Encoding/Precision | Rounding |
|---|---|---|---|---|
| Text | Unicode strings | Base64 text | Exact characters | None |
| File (encode) | Any readable bytes | Base64 text or data string | Exact bytes → Base64 | None |
| File (decode) | Text file containing Base64 | Text or bytes preview | Selected text encoding | None |
| Summary | Inputs and totals JSON | JSON snapshot | Character and byte counts | None |
Networking and storage: Processing occurs in the browser. No requests are made to external services. Opening a data string uses a new tab or window provided by the browser.
Performance and complexity: Encoding and decoding run in time proportional to input size. Bytes are processed in chunks to reduce peak memory during string conversion.
Diagnostics and determinism: Identical inputs with the same options yield identical outputs. Errors are reported with concise messages and byte and character totals are shown for context.
Security considerations: Treat untrusted data strings cautiously. Avoid opening unknown content. Do not paste secrets into shared environments. Padding and wrapping choices do not provide confidentiality.
? on encode.Privacy & compliance: Files are processed locally; nothing is uploaded. No data is transmitted or stored server‑side.
Base64 encoding and decoding converts bytes to readable characters and back with consistent, inspectable results.
Example: Encode a small PNG file with a MIME type of image/png to get a compact data string suitable for embedding in a note.
You now have a clear, portable representation you can decode anywhere.
No. Processing happens in the browser and no server receives your inputs or results.
Files are handled locally.Byte counts reflect exact input and output sizes. Wrapping adds newline characters, which are included in the character count.
No rounding is applied.UTF‑8, UTF‑16LE, ISO‑8859‑1 (Latin‑1), and ASCII are available. Choose the one that matches the text you expect.
Mismatched encodings produce garbled symbols.It switches the alphabet to use - and _ instead of + and /. Decoding accepts either style.
Paste the text that starts with data:, then decode. The prefix is ignored and only the Base64 segment is processed.
Yes. All computation runs locally in your browser.
Opening a preview uses a new tab.No pricing or licensing terms are presented here. Use in line with your organization’s policies.
Check internal guidance when sharing data.- and _ instead of + and /.= characters indicating partial byte groups.data:<mime>;base64,.