Base64 Encode and Decode — Online

Encode text to Base64 or decode Base64 back to text, instantly and privately in your browser. Full UTF-8 support.

📦

Base64 Encode / Decode

Text • encode/decode

0 chars
0 chars

How to Use the Base64 Encode / Decode

  1. Pick a direction — use the toggle at the top (e.g. encode vs decode).
  2. Type or paste your text — the result updates live as you type; large inputs are fine.
  3. Copy the result — one click copies the output to your clipboard.
  4. Swap — flip the direction (⇄) to reverse the conversion instantly.

Why Use This Base64 Encode / Decode

🎯

Reversible in one click

Encoding and decoding share the page, so any result can be pasted straight back to confirm it round-trips to the text you started with — the quickest check that nothing was mangled.

Live as you type

Results are recalculated on every keystroke, with no submit step and no page reload, so a value can be adjusted until the answer looks right rather than guessed once.

🔒

100% private

Everything runs in your browser — no account, no uploads, nothing leaves your device.

Understanding the Base64 Encode / Decode

Base64 is an encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, + and /). It was designed so binary content — images, files, keys — can travel safely through systems built for text, such as email (MIME), JSON payloads, HTML data URIs and HTTP headers. Base64 is encoding for safe transport, not encryption, so it adds no security on its own.

Developers across the US reach for Base64 every day: embedding small images in CSS/HTML, encoding API tokens and Basic-Auth credentials, storing binary blobs inside JSON, and inspecting JWTs. This converter encodes and decodes instantly with full UTF-8 support, entirely in your browser — paste, read, copy. Nothing is uploaded, so it is safe for tokens and private data.

Formula & Logic

Base64 encodes binary data using only 64 printable ASCII characters, so that arbitrary bytes can survive transmission through systems that expect text — email bodies, JSON fields, data URIs. It is emphatically not encryption: the transformation is public, reversible and offers no confidentiality whatsoever, a misunderstanding that appears in real security incidents with depressing regularity. The mechanism regroups bits: three bytes (24 bits) become four 6-bit groups, each mapped to one character. That 3-to-4 expansion is why base64 output is always about 33% larger than its input.

Take 3 bytes (24 bits) → split into 4 groups of 6 bits → map each to the alphabetAlphabet: A–Z (0–25), a–z (26–51), 0–9 (52–61), + (62), / (63)Pad with "=" so output length is a multiple of 4Output size ≈ input × 4/3

where:

6 bits
64 possible values, hence the name
=
padding, indicating the input was not a multiple of 3 bytes
URL-safe variant
replaces + and / with - and _ so the string survives in a URL

Assumptions: Encoding, not encryption — anyone can decode it instantly. Never use it to protect credentials. The 33% size increase matters when embedding images as data URIs.

Step-by-Step Example: Encoding "Hi" to Base64

Follow two bytes through the bit-regrouping, including the padding.

  • InputHi (2 characters)
  1. ASCII codes: H = 72, i = 105.
  2. In binary: 01001000 and 01101001 — 16 bits total.
  3. Pad to a multiple of 6 by appending two zero bits: 010010 000110 1001 00.
  4. The groups are 010010 = 18, 000110 = 6, and 100100 = 36 after padding.
  5. Map through the alphabet: 18 = S, 6 = G, 36 = k.
  6. Only two of three input bytes were present, so append one "=" — giving SGk=.

Result"Hi" encodes to "SGk="

A longer input avoids padding: "Hello" (5 bytes) encodes to SGVsbG8=, still with one pad because 5 is not a multiple of 3. The trailing "=" characters are the quickest visual signal that a string is base64 rather than a hash or a token.

Base64 Encode / Decode FAQ

Base64 represents binary data using 64 ASCII characters so it can travel safely through text-only systems like email, JSON and data URLs. It is encoding, not encryption.
No. Encoding and decoding happen entirely in your browser — nothing is uploaded.

Related Converters

✔ Written & reviewed by Dr Sam — 20+ yrs in management & research leadership📅 Last updated September 2026📚 Sources: IETF RFC 4648, RFC 3986 & WHATWG/W3C specifications📑 How we build & check these