Use this free Base64 encode online tool to turn plain text into a Base64 string. Live output, Auto mode, copy, and download. Everything runs in your browser.
A Base64 encode online utility turns arbitrary bytes into a text-safe string using a fixed alphabet (A–Z, a–z, 0–9, +, /) and = padding. It is a binary-to-text encoding, not encryption: anyone can reverse it. The encoding walks the input in groups of three bytes (24 bits), maps each group to four 6-bit indices, and emits one character per index. When the length is not a multiple of three, the final group is padded so the output length is always a multiple of four. Expect roughly a 33% size increase compared to the original binary payload, before you add line breaks.
On the web, “text” is usually UTF-8. This Base64 encode flow treats your input as UTF-8, converts those bytes, and shows the result as you type. URL-safe variants swap +// for -/_. If you need byte-exact file handling, pair this page with image and file to Base64, which reads raw file bytes locally.
POST JSON to /api/base64 with type: "encode"—treat the endpoint like any shared service and do not send secrets you are not allowed to process on a server.A minimal example: the word hello encodes to aGVsbG8=. Type hello in the tool and watch the output. For JSON, you might encode {"ok":true} so the payload can sit next to other string-typed fields—still transport encoding, not protection. If you need privacy, add real cryptography; never rely on Base64 alone.
For a quick round-trip, paste aGVsbG8= into the decode tool and confirm the original hello returns. After you generate a data URL for a tiny inline asset, you can open Base64 to image to preview raster output.
+// or convert explicitly.APIs and configuration: services return small binary artifacts—public keys, signatures, thumbnails—as Base64 inside JSON. Client apps decode to bytes before use. Base64 is easy to copy, diff, and log. Pair debugging with the sitemap generator when you publish new doc URLs for those APIs.
Email (MIME): attachments historically used Base64 so binary could ride on text transports. The pattern still influences many protocols.
Images and data URLs: a data URL bundles MIME type and Base64 payload in one string for a small src= attribute. For large photos, prefer normal URLs and CDNs. When you have a data URL, preview it with the Base64 to image tool. For a conceptual comparison, see the Base64 vs UTF-8 article on the blog.
The encoder walks the UTF-8 byte stream left to right. Every 24 bits (three bytes) become four 6-bit indices; each index picks one character from the 64-symbol alphabet. If the stream length is not divisible by three, the final quantum is padded with zero bits and one or two = characters so the output length stays a multiple of four. That padding is not secret data—it only signals how many bits in the last block were meaningful.
Formally, RFC 4648 defines the Base64 alphabet most tools use. URL-safe profiles replace + and / with - and _ so strings survive unescaped in query parameters. Nothing in this process authenticates or compresses data; it only re-encodes bytes as printable ASCII.
In the browser, btoa works for Latin-1–only strings. For full UTF-8, use TextEncoder then btoa on binary chunks, or a small helper library. In Node,Buffer.from(text, "utf8").toString("base64") is the common path.
import base64
text = "hello, 世界".encode("utf-8")
out = base64.b64encode(text).decode("ascii")
| Profile | 62nd / 63rd chars | Typical use |
|---|---|---|
| Standard | + and / | PEM, MIME, many APIs in JSON |
| URL-safe (Base64url) | - and _ (padding often omitted in JWT) | JWT segments, some query params |
Plain text → Base64 (UTF-8). Live updates for inputs under the size limit.
Last: encode
Result
Type or paste above to see output instantly.