Skip to content
codevory

Base64 Encoder

Encode text to Base64 in your browser. Handles Unicode, the URL-safe alphabet and MIME line wrapping.

Base64 Encoder: the tool

Type or paste text to encode it as Base64.

Input

Base64

The result appears here.

How to use Base64 Encoder

  1. Type or paste the text to encode. The Base64 result appears as you type.
  2. Turn on URL-safe if the value goes in a URL, a filename or a JWT: it swaps + and / for - and _.
  3. Turn off padding to drop the trailing = characters, as many URL-safe formats do.
  4. 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).

Text
Héllo, Codevory! 👋
Base64
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

VariantCharacters 62 and 63PaddingTypical use
Standard (RFC 4648 §4)+ and /RequiredData URIs, email, JSON fields
URL-safe (RFC 4648 §5)- and _Often omittedURLs, filenames, JWT segments
MIME (RFC 2045)+ and /RequiredEmail 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.