Base64 Encode — Encode Text to Base64 in Your Browser
Encode text strings to Base64. UTF-8 and Latin-1 input supported, runs entirely in your browser. No uploads, no accounts, no limits.
Base64 encoding is older than the web — it was specified in RFC 4648 in 2006 but used in MIME email attachments since 1996 and in uuencode before that. Its job is narrow: turn any sequence of bytes into a printable ASCII string that survives any text-only channel. It is not encryption (anyone can decode it), it is not compression (the output is always 33 percent larger than the input), and it is not a hash (the encoding is fully reversible). The right framing is that Base64 is a transport encoding, like quoted-printable or hex, and it earns its place because every system that handles text also handles Base64 without extra configuration.
The encoding itself is mechanical: take the input bytes three at a time, treat each group of 24 bits as four 6-bit values, look up each 6-bit value in the 64-character alphabet (A-Z, a-z, 0-9, +, /), and pad the output with = characters if the input length is not a multiple of three. That is the entire algorithm. The reason a tool like this exists is that the encoding is rarely the only step — the input is usually text in some specific character encoding (UTF-8, Latin-1, Windows-1252), and the output is usually destined for somewhere that has additional rules (URL-safe variant, line wrapping, MIME-compliant padding). Getting all of those right manually is the chore the tool removes.
For a final hand-off: if the encoded payload is going into a URL or a filename, switch to URL-safe Base64 to avoid the +, /, and = characters that have special meaning in URLs. If the payload is going into a JWT or a SAML assertion, the JWT-specific tools know the Base64URL variant natively and will save you a step. If you need to encode binary data (an image, a certificate), use the image-specific tools — they handle the binary-to-text conversion automatically without the file getting opened as the wrong type.
How to use
Type or paste the text
Drop the text into the input area. Multi-line text is supported — newline characters are encoded as `Cg==` per Base64 standard, so the output is a single line per input line.
Pick an input encoding
Default is UTF-8, which covers the majority of web content. Switch to Latin-1 if the source text was encoded for older web pages, email subject lines, or legacy databases that predate Unicode.
Copy or download the result
Copy the Base64 to your clipboard, or download it as a .b64 file. The output preserves whitespace from the input so you can round-trip multi-line text without surprises.
Frequently asked
Does the encoder handle Unicode characters?
Yes — UTF-8 is the default and handles every Unicode character correctly. The encoder converts each character to its UTF-8 byte sequence first, then Base64-encodes the bytes. Chinese, Arabic, and emoji round-trip cleanly.
What is the URL-safe variant?
Standard Base64 uses `+`, `/`, and `=` which need URL-encoding in query strings. URL-safe Base64 (RFC 4648 §5) replaces those with `-`, `_`, and drops padding. Toggle the option to switch.
How big is the encoded output?
Base64 expands the input by exactly 4/3 (33 percent overhead). A 100-byte string becomes a 136-character Base64 string, with `=` padding characters added to round the length up to a multiple of 4.
Can it encode binary files?
The text encoder expects text input. For binary files (images, PDFs, audio), use the Image-to-Base64 tool for images, or convert the file to a text-safe hex dump first and encode the hex string.
Is line-wrapping added to the output?
No — the output is a single unbroken line by default. Standard MIME encoding wraps at 76 characters; if you need that variant for an email attachment, toggle the wrap option in the settings.
Limitations
- Text input onlyThe encoder accepts text in UTF-8 or Latin-1. Binary payloads (images, PDFs, audio) need a different tool — use Image-to-Base64 for images or hex-encode the file first for other formats.
- 33 percent size overheadBase64 always expands the input by 4/3. A 1 KB text file becomes 1.37 KB after encoding. This is the cost of fitting arbitrary bytes into a 64-character ASCII alphabet; there is no compression option.
- No integrity checkBase64 is a reversible encoding, not a hash. Decoding any valid Base64 string gives back the exact original bytes. If you need tamper detection, pair Base64 with a SHA-256 hash from the hashing tools.
Platform notes
- macOS
- macOS ships `base64` in the terminal as a CLI fallback. This browser tool is the right pick when you do not want to open Terminal or you need Unicode handling that the CLI requires flags to enable.
- Windows
- PowerShell's `[System.Convert]::ToBase64String([Text.Encoding]::UTF8.GetBytes('text'))` is the CLI equivalent. The browser tool avoids the quoting headache for payloads with single quotes or special characters.
- Linux
- GNU coreutils ships `base64` with `-w 0` to disable line wrapping. The browser tool is the right pick for text copied from a chat window, an email, or a documentation page where retyping into a terminal is impractical.
- Web
- Runs entirely client-side. Works offline once the page has loaded. Useful for ad-hoc encodings in restricted environments where installing command-line tools is not an option.