What this tool does
Encode Unicode text to Base64 or decode Base64 back to readable text with selected inputs processed locally in your browser.
Privacy behavior
Selected file contents are processed locally in your browser for supported workflows. This privacy build does not intentionally load ads, analytics, remote fonts, or third-party runtime scripts.
Supported workflow
Use the controls on this page, review the output in your browser, then copy or download the result.
When should you use Base64?
Base64 is commonly used to represent text or binary data in APIs, embeds, tokens, and data transfer workflows where plain text transport is needed.
This tool validates Base64 before decoding and supports URL-safe variants that use hyphens and underscores.
How Base64 encoding works
Base64 represents binary data using only 64 printable ASCII characters: A-Z, a-z, 0-9, plus + and /, with = reserved for padding. It works by regrouping input bytes into 6-bit chunks, since 2 to the 6th power is 64, and mapping each chunk to one alphabet character. Three input bytes are exactly 24 bits, which splits evenly into four 6-bit groups, so Base64 always processes input in groups of 3 bytes and emits 4 output characters per group, padding the final group with = when the input length is not a multiple of 3.
This tool encodes by first converting text to UTF-8 bytes with TextEncoder, then building a one-byte-per-character binary string before calling btoa(). That extra step matters: calling btoa() directly on a JavaScript string containing characters above code point 255 throws an error, because btoa() only understands one byte per character. Decoding reverses the process with atob() followed by TextDecoder("utf-8", { fatal: true }), so decoded bytes must form valid UTF-8 or the tool reports an error instead of guessing.
The URL-safe checkbox switches to Base64url, defined in RFC 4648 section 5: the same alphabet with - replacing + and _ replacing /, with padding removed entirely.
| Property | Standard Base64 | Base64url (this tool, URL-safe checked) |
| Characters 62 and 63 | + and / | - and _ |
| Padding | = characters kept | Stripped after encoding |
| Safe unmodified in a URL query string | No, + and / need percent-encoding | Yes |
| Typical use | Email attachments, data URIs | JWT segments, URL-embedded tokens |
| Output size versus input | About 33 percent larger | About 33 percent larger |
Worked examples
Padding length depends only on input length modulo 3, shown here with a classic three-line demonstration:
| Input | Length | Base64 output | Padding |
any carnal pleasure. | 20 bytes | YW55IGNhcm5hbCBwbGVhc3VyZS4= | 1 character |
any carnal pleasure | 19 bytes | YW55IGNhcm5hbCBwbGVhc3VyZQ== | 2 characters |
any carnal pleasur | 18 bytes | YW55IGNhcm5hbCBwbGVhc3Vy | None |
Dropping one character shifts the input length modulo 3 from 2 to 1 to 0, which is why the padding count counts down from one = to two and then to none. Unicode input shows the same mechanics with an extra twist: café is 4 characters but 5 bytes in UTF-8, since é encodes as two bytes (0xC3 0xA9), so it encodes to Y2Fmw6k=, an 8-character result with 1 padding character, computed from the byte count rather than the character count.
Frequently Asked Questions
Is this Base64 tool free?
Yes. You can encode, decode, copy, and clear text without signup.
Is my text sent to ConvertUnlimited servers?
No server-side upload endpoint is used for this flow; encoding and decoding happen locally in your browser.
Does it support Unicode?
Yes. Text is converted to UTF-8 bytes before encoding, so emoji, accents, and non-Latin scripts round-trip correctly.
What is URL-safe Base64?
URL-safe Base64, or Base64url, replaces + and / with - and _ and removes padding, so encoded text can sit directly in a URL without percent-encoding.
What happens with invalid Base64?
The tool shows a friendly warning and keeps your original input rather than guessing at a partial decode.
Why did btoa() fail when I tried this in my own code?
Standard btoa() only accepts one byte per character and throws on Unicode text above code point 255. This tool avoids that by encoding text to UTF-8 bytes first, building a byte-safe string, and only then calling btoa().
Can this decode a Base64 image or file back to binary?
No. Decoding always assumes the result is UTF-8 text, so Base64 representing binary files such as images or PDFs will fail with a decode error rather than producing a downloadable file.
What is the difference between standard Base64 and Base64url?
Both use the same 6-bit grouping and 64-character logic. Standard Base64 uses + and / with = padding; Base64url swaps in - and _ and drops padding so the result is safe to use unmodified in URLs and tokens.
Privacy
Privacy build: This build removes ads, analytics, remote fonts, runtime CDN scripts, and file-operation telemetry. Selected files are processed in the browser using local JavaScript and browser APIs.
ConvertUnlimited does not provide a server-side upload endpoint for this Base64 encoding and decoding flow. Text input is processed locally in your browser.
Terms of Use
ConvertUnlimited is provided as is. Review encoded or decoded output before using it in production systems.
Trust and privacy
Files are processed locally where supported. Review the Trust Center for the processing model and the Privacy Policy for public-site privacy boundaries.