Base64 Encode
Convert text to Base64 for use in data URIs, HTTP headers, JSON payloads or email, with URL-safe and MIME-wrapped variants.
- Runs in your browser
- Free, no sign-up
What this tool gives you
Correct UTF-8 handling
Accents and emoji are encoded as UTF-8 bytes, matching what servers expect.
Base64url option
The alphabet used by JWTs, URL parameters and file names.
MIME wrapping
Insert line breaks every 76 characters for email bodies and certificates.
Frequently asked questions
How much bigger is the output?
Base64 produces four characters for every three bytes, so the encoded text is about 33 percent larger than the UTF-8 input, plus padding.
When should I use Base64url?
Whenever the value travels inside a URL or a file name. The standard alphabet contains + and / which have special meaning there.
Can I encode a file?
Not with this page, which works on text. Use a terminal command such as base64 file.png, or a data-URI generator, for binary files.
Why does the output end with = signs?
Padding marks an input length that is not a multiple of three bytes. Many decoders accept missing padding, which is why the no-padding option exists.