Skip to content

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 strings back to plain text, commonly used in web development and data transfer.

0 characters 0 words

Related Tools

Morse Code Translator Binary & Hex Converter URL Encoder & Decoder HTML Encoder & Decoder Strip HTML Tags

How to Use

  1. Enter Text or Base64 — Paste plain text to encode or a Base64 string to decode into the input field.
  2. Choose Encode or Decode — Select Encode to turn your text into Base64 or Decode to turn a Base64 string back into readable text. Tick URL-safe to use the - and _ alphabet without padding.
  3. Copy the Output — The result updates as you type (or click Encode / Decode). Use Copy or Download to save the result.

About the Base64 Encoder & Decoder

The Base64 Encoder & Decoder converts text to Base64 and back, updating as you type. It encodes the UTF-8 bytes of your text, so accented letters, CJK characters and emoji survive the round trip, and it can produce URL-safe Base64 for tokens and links. Developers use it to read or build HTTP Basic credentials, inspect the parts of a JSON Web Token, decode a data URI, and check what an API actually sent.

How it works

Worked examples

InputModeResult
Man / Ma / MEncodeTWFu / TWE= / TQ==
Hello, World!EncodeSGVsbG8sIFdvcmxkIQ==
café (5 bytes: é is 2)EncodeY2Fmw6k=
>>>???Encode / URL-safePj4+Pz8/ / Pj4-Pz8_
😀Encode / URL-safe8J+YgA== / 8J-YgA
data:text/plain;base64,SGk=DecodeHi
/9j/4AAQDecodeBinary data, 6 bytes (the start of a JPEG file)

Errors and edge cases

When to use it, and when not to

Base64 exists to carry bytes through channels built for text: email attachments (MIME), data URIs, JSON and XML payloads, PEM certificates and keys, and the HTTP Basic Authorization header, which is simply Base64 of username:password (user:pass becomes dXNlcjpwYXNz). That example is also the warning: Base64 is an encoding, not encryption. Anyone can decode it, so it never protects a password or secret. JSON Web Tokens use the URL-safe alphabet without padding for each dot-separated part, so you can paste a token's header or payload here, one part at a time, to read it. The Base64 guide walks through the algorithm bit by bit; for the %20 style of encoding used in links, use the URL Encoder & Decoder.

Encoding and decoding run in your browser, which matters when the string is a credential or token: nothing is sent to a server.

Frequently Asked Questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /). It is designed to carry binary data across systems that only support text, such as email (MIME) and JSON payloads.

Why does Base64-encoded data appear longer than the original?

Base64 encoding increases data size by approximately 33%. Every three bytes of input produce four Base64 characters. This overhead is the trade-off for ensuring the data can pass safely through text-only channels without corruption.

What are common use cases for Base64?

Base64 is used to embed images in HTML and CSS via data URIs, encode email attachments in MIME format, transmit binary data in JSON and XML APIs, store authentication tokens (e.g., HTTP Basic Auth headers), and encode cryptographic keys and certificates in PEM format.

Is Base64 a form of encryption?

No. Base64 is an encoding scheme, not an encryption algorithm. It does not provide confidentiality or security. Anyone with a Base64 decoder can reverse the encoding instantly. For secure data transmission, use proper encryption (AES, TLS) in combination with Base64 if needed.

Does the tool handle UTF-8 characters?

Yes. The encoder first converts the input text to its UTF-8 byte sequence and then Base64-encodes those bytes. The decoder reverses the process, correctly restoring multi-byte characters including accented letters, emojis, and CJK ideographs.

What is the difference between standard Base64 and URL-safe Base64?

Standard Base64 uses + and / as its 63rd and 64th characters, with = as padding. URL-safe Base64 replaces + with - and / with _, avoiding characters that have special meaning in URLs, and usually drops the = padding. Tick the URL-safe option to encode in that format; the decoder accepts either alphabet, with or without padding.