Base64 Encoder
Encode text to Base64 in your browser. Handles Unicode, the URL-safe alphabet and MIME line wrapping.
Base64 Encoder: the tool
Input
Base64
The result appears here.How to use Base64 Encoder
- Type or paste the text to encode. The Base64 result appears as you type.
- Turn on URL-safe if the value goes in a URL, a filename or a JWT: it swaps + and / for - and _.
- Turn off padding to drop the trailing = characters, as many URL-safe formats do.
- Copy the result or download it as a text file. To go the other way, use the Base64 decoder.
Example
A short text with accents and an emoji, encoded with the default settings (standard alphabet, padding).
Héllo, Codevory! 👋
SMOpbGxvLCBDb2Rldm9yeSEg8J+Riw==
About this tool
Base64 turns any sequence of bytes into 64 printable characters, so binary or non-ASCII data can travel through systems built for plain text, such as email, JSON and URLs. Every 3 bytes become 4 characters, so the encoded text is about a third larger than the original.
This tool first converts your text to UTF-8 bytes and then encodes them. Accents, non-Latin scripts and emoji therefore come out as other Base64 tools and programming languages produce them. The result is identical to Buffer.from(text).toString('base64') in Node.js.
Base64 is an encoding, not encryption. Anyone can decode it, so it hides nothing. Use it for transport and storage format, never to protect secrets.
Base64 variants
| Variant | Characters 62 and 63 | Padding | Typical use |
|---|---|---|---|
| Standard (RFC 4648 §4) | + and / | Required | Data URIs, email, JSON fields |
| URL-safe (RFC 4648 §5) | - and _ | Often omitted | URLs, filenames, JWT segments |
| MIME (RFC 2045) | + and / | Required | Email attachments, lines of 76 characters |
Frequently asked questions
Is Base64 a form of encryption?
No. Base64 only changes how bytes are written. Anyone can reverse it instantly, so never use it to hide passwords or tokens.
Why is the Base64 output longer than the input?
Each group of 3 bytes is written as 4 characters, which makes the result about 33% larger. Line breaks and padding add a little more.
Does this encoder support Unicode and emoji?
Yes. Text is converted to UTF-8 before encoding, so every character is supported. Be aware that the browser function btoa() fails on characters above U+00FF, which is why many snippets online break on emoji.
What are the = signs at the end?
Padding. Base64 works in blocks of 4 characters, and = fills the last block when the input length is not a multiple of 3. It carries no data, so URL-safe formats often leave it out.
Can I encode a file or an image?
This tool encodes text. To embed a file, convert it with a command such as base64 file.png on Linux and macOS, or certutil -encode on Windows.
More developer tools
- b64Base64 DecoderDecode Base64 and Base64URL to text. Whitespace, missing padding and data URI prefixes are handled, and errors name the exact character.
- %20URL EncoderPercent-encode text for URLs: a single component, a full URL, or form data. Unicode is encoded as UTF-8.
- jwtJWT DecoderDecode a JSON Web Token locally to read its header, payload and claims. It does not verify the signature, so a decoded token is never reported as valid.
- #a1Hash GeneratorCompute MD5, SHA-1, SHA-256, SHA-384 and SHA-512 of any text at once, or add a key to get HMAC values. Everything runs in your browser.