Base64 encoder / decoder
Encode text to Base64 or decode Base64 to text — instantly in your browser. Edit either side and the other updates automatically.
Type or paste plain text on the left to encode it, or paste a Base64 string on the right to decode it. Toggle URL-safe mode to switch between standard and RFC 4648 §5 URL-safe encoding.
Base64 encoder and decoder
Edit either side — both update automatically
0 bytes
0 chars
When to use Base64
Base64 is useful when you need to include binary or special-character content
inside a format that only handles ASCII text safely. Common use cases include
embedding images directly in HTML or CSS as
data: URIs, encoding binary values in
JSON, transmitting binary data in HTTP headers, and storing small binary blobs
in databases that are text-indexed. The ~33% size overhead is the trade-off.
URL-safe Base64 is the right choice when the encoded string will appear in a
URL, query parameter, or JWT — it avoids the +
and / characters that have special
meanings in those contexts. Standard Base64 is fine for email, HTML data
URIs, and most other uses.
About this tool
This tool bidirectionally encodes and decodes Base64 in your browser. Enter plain text on the left to see the Base64-encoded value on the right, or paste Base64 on the right to decode it back to plain text on the left. Supports standard Base64 (RFC 4648) and URL-safe Base64 (replaces + with - and / with _, removes padding) via a toggle. Full Unicode support. Byte counts for both sides. Nothing is transmitted to a server.
Frequently asked questions
What is Base64?
Base64 is an encoding scheme that represents binary data as ASCII text. It maps every 3 bytes of input to 4 printable characters using a 64-character alphabet (A–Z, a–z, 0–9, +, /). Because the output only uses printable characters with no special meaning in common formats, Base64 is used wherever binary data needs to be transported through systems that handle text — email attachments (MIME), embedding images in HTML (data URIs), storing binary config values in JSON, and encoding JWTs. It is not encryption and provides no security benefit.
What is URL-safe Base64?
Standard Base64 uses + and / as characters 62 and 63 in its alphabet. These characters have special meanings in URLs — + is decoded as a space, and / is a path separator. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, making the output safe to embed in URLs and HTTP headers without percent-encoding. It also typically omits the trailing = padding characters. This variant is used in JWTs, many OAuth flows, and URL-safe identifiers.
Is Base64 the same as encryption?
No. Base64 is encoding, not encryption — it's a completely reversible transformation that any decoder can undo without a key. Anyone who receives a Base64 string can decode it immediately. Its purpose is to make binary data safe for text-based systems, not to protect the data from being read. Never use Base64 alone to protect sensitive data; use encryption (AES, RSA) for that.
Why is the output longer than the input?
Base64 encodes 3 bytes as 4 characters, so it increases the data size by approximately 4/3 (about 33% larger). The output is padded with = characters so its length is always a multiple of 4. For example, 3 bytes → 4 characters, 4 bytes → 8 characters with 1 padding =, 5 bytes → 8 characters with 1 padding =, 6 bytes → 8 characters with no padding. The size increase is acceptable when the alternative is a binary payload being mangled by a text-only transport protocol.