Base64 Encode / Decode

Encodes and decodes Base64 in real time — accepts text and images, both directions.

Content type

What Base64 is

Base64 represents binary data (bytes) as plain text, using a 64-character alphabet safe to carry over any channel that only expects text (JSON, XML, email, URLs, Data URIs). Every 3 original bytes become 4 Base64 characters — so the result is always about 33% larger than the original input. It isn't encryption: anyone with the Base64 recovers the original content instantly, with no key needed.

Full Data URI vs. Base64 only

Image → Base64 mode always shows both forms. The full Data URI (data:image/png;base64,...) is ready to paste directly into CSS (background-image: url(...)), HTML (<img src="...">), or anywhere a URL is accepted. The raw Base64 is just the payload, with no prefix — the format most APIs expect when receiving an image inside JSON.

How Decode recognizes the image format

When the input is a Data URI, the type declared there (image/png, image/jpeg, etc.) is used directly. When it's raw Base64 — no metadata at all — the only way to know the format is to inspect the first decoded bytes: PNG, JPEG, GIF, WebP and BMP each have their own unique binary signature; SVG is recognized as text starting with the <svg> tag. A Base64 that doesn't match any of these six formats is flagged as unrecognized instead of trying to display something broken.

Frequently asked questions

Because every 3 original bytes become 4 Base64 characters — a roughly 33% increase inherent to the format itself, not an inefficiency of this tool.

Base64 has strict alphabet and length rules — a character outside the alphabet, or a length that isn't a valid multiple of 4, invalidates the whole decode. In Text mode, even syntactically valid Base64 can fail if the decoded bytes don't form valid UTF-8.

Yes. Decode automatically normalizes the URL-safe alphabet (common in JWTs and tokens) and strips whitespace/line breaks (common in Base64 exported in 76-column blocks) before decoding — no option to toggle, it's always accepted.

The full Data URI already includes the data:<type>;base64, prefix — paste it directly into CSS/HTML. "Base64 only" is just the payload, with no prefix — the format most APIs expect when sending an image inside JSON.

By inspecting the first decoded bytes: each image format (PNG, JPEG, GIF, WebP, BMP) starts with its own unique byte sequence; SVG is recognized as text starting with the <svg> tag.

The Base64 decodes fine, but the resulting bytes don't match any of the six recognized formats (PNG, JPEG, GIF, WebP, BMP, SVG) — it's probably not an image, or a format this version of the tool doesn't recognize yet.

No. File reading, encoding, decoding and the image preview all happen entirely in your browser — no network call, no upload to any server, same as every client-side tool in Nexinon.