Text to Base64
Type or paste text, get Base64 instantly: UTF-8 safe for emoji and every language, with URL-safe alphabet, padding and MIME wrapping options. All in your browser.
File to Base64
Drag a file here or browse
Any file type · up to 50 MB · converted locally in bounded chunks, the file never leaves your browser
Base64 to file
Paste Base64 or a full data: URI. The decoded size is estimated before anything runs, the type is verified against the actual bytes, and you can download the result.
Strict Base64 validator (RFC 4648)
Checks alphabet, padding, length and canonical pad bits. Valid, canonical, normalized and malformed are four different verdicts, and this validator tells you which one you have.
Base64 ↔ hex
Bounded at 2 MB of data per direction. Bytes with no valid UTF-8 meaning are fine here: hex is the binary-safe view.
The three output formats that cover real use
Standard Base64 with padding is what JSON payloads, XML and most APIs expect. URL-safe without padding is what JWTs, OAuth state values and file-name-embedded data need. MIME wrapped at 76 characters is what email source and PEM-style blocks use. The three toggles above the panes produce each of them from the same UTF-8 bytes, and the status line under the output confirms alphabet and padding, so what you copy is what the destination parses.
Text to Base64 FAQ
Which encoding does text use before it becomes Base64?
UTF-8, and that choice matters. Base64 encodes bytes, not characters, so text must become bytes first, and both sides must agree on how. UTF-8 is the interoperable default across the web: this encoder converts your text to UTF-8 bytes and encodes those, which is why emoji, Chinese text and accented characters survive the round trip while btoa-based tools throw errors on them.
When should I use the URL-safe option?
Whenever the output travels inside a URL, a filename, or any format where + and / have meaning: + becomes a space in query strings and / splits paths. The URL-safe toggle produces the RFC 4648 base64url variant with - and _, and combined with the strip-padding option you get exactly the format JWTs and most web APIs expect.
What does the MIME wrap option do?
It inserts a line break every 76 characters, the format email transport (MIME) historically requires for encoded bodies and attachments. Use it when pasting into email source, certificates or other line-length-sensitive formats. Leave it off for URLs, JSON and HTML attributes, where line breaks would corrupt the value. Decoders, including this one, ignore the breaks either way.
How much bigger does my text get?
Exactly 4 characters of Base64 for every 3 bytes of UTF-8, about 33 percent, plus padding. Note that bytes, not characters, drive the size: an emoji is one grapheme but 4 UTF-8 bytes, and a Chinese character is typically 3. The stats under both panes show graphemes, code points and UTF-8 bytes so the size math is never a mystery.
Is the text I encode sent anywhere?
No. Encoding runs entirely in your browser tab: no upload, no server, no logging, and the page keeps working offline. Passwords for Basic Auth headers, tokens and config values can be encoded here without them ever leaving your machine. Remember that Base64 itself is not encryption: anyone who sees the output can decode it.
More free tools: Base64 to Text · Image to Base64 · Base64 Validator · Full Base64 Workbench