A field guide to Base64 base64s
RFC 4648 · Standard & URL-safeEncoded in your browser, never on a server

base64s.com — Paste to begin

Binary, made legible.

Paste text or Base64. The page decides whether to encode or decode, and the result appears at once.

Paste here
Result
§1Principles

Three promises, kept by design.

Nothing leaves.

Every conversion happens inside your browser tab. Tokens, keys and private payloads are never uploaded, logged or stored.

Nothing waits.

No file-size ceilings and no queues. Large inputs convert at the speed of your own device.

Nothing missing.

Standard and URL-safe alphabets, padding on or off, full UTF-8, and decoding that recognises both variants.

§2In the wild

Where Base64 quietly works.

Inline images

Small icons embedded straight into HTML and CSS.

data:image/png;base64,iVBORw0KGgo…

APIs & JSON

Files and signatures carried through text-only payloads.

"file": "JVBERi0xLjQK…"

Email

Every MIME attachment travels as Base64.

Content-Transfer-Encoding: base64

Tokens

JWTs use Base64URL to survive URLs and headers.

eyJhbGciOiJIUzI1NiJ9.…
§3Method

Three bytes become four letters.

Fig. 1Encoding “” Out
3→4

Which is why Base64 text is always about a third longer than the data it carries.

  1. Gather the input three bytes (twenty-four bits) at a time.
  2. Divide those bits into four groups of six, each a number from 0 to 63.
  3. Translate each number into a letter of the 64-character alphabet.
  4. Pad an incomplete final group with = so the length divides by four.
InputM a n  ·  77 97 110 Bits010011 010110 000101 101110 Index19 22 5 46 OutputT W F u
§4Appendix

The same idea, in every language.

LanguageEncodeDecode
JavaScriptbtoa(str)atob(b64)
Node.jsBuffer.from(s).toString("base64")Buffer.from(b64, "base64")
Pythonbase64.b64encode(b)base64.b64decode(s)
Shellecho -n "hi" | base64echo "aGk=" | base64 -d
Gobase64.StdEncoding.EncodeToString(b)base64.StdEncoding.DecodeString(s)
§5Questions

Things people often ask.

i.Is Base64 a kind of encryption?

No. It is an encoding, fully reversible by anyone. For secrecy, use encryption such as AES.

ii.Base64 or Base64URL?

Base64URL swaps +/ for -_ and usually drops padding, making it safe in URLs, filenames and JWTs.

iii.What is the trailing “=”?

Padding, which rounds the length up to a multiple of four. Most decoders accept text without it.

iv.Why is the output larger?

Every three bytes become four characters, so encoded text runs about 33% longer than the original.

v.Why does decoding look garbled?

Usually stray whitespace, a mixed-up alphabet, or binary data such as an image being read as text.

vi.Is my data ever uploaded?

Never. base64s is built to run entirely in your browser, with no server-side processing at all.

Already here.

The converter at the top of this page is the whole tool. What you paste stays on your machine.

Back to the top