How To Guide

How to Encode/Decode Base64 Online (Free, Browser-Based)

Encode strings, files, or images to Base64 and decode Base64 back to plain text — instant, client-side, no uploads. Supports UTF-8, binary, and data URIs.

What Base64 is for (and what it isn't)

Base64 is an encoding, not encryption. It represents arbitrary binary data using only 64 printable ASCII characters, which makes it safe to paste into contexts that only accept text: HTTP headers, JSON strings, XML, email bodies, and URL parameters. Anyone with the encoded string can decode it — there is no key. The Base64 encoder/decoder runs both directions.

Common places you'll see Base64

  • HTTP Basic AuthAuthorization: Basic dXNlcjpwYXNz is user:pass Base64-encoded
  • JSON Web Tokens — JWTs are three Base64URL-encoded blocks separated by dots
  • Data URIsdata:image/png;base64,iVBORw0... inlines a whole image in CSS/HTML
  • Email attachments — MIME encodes binary attachments as Base64 in the message body
  • Kubernetes Secrets — stored as Base64 (which is why they're often mistakenly called encrypted)
  • OAuth client secrets — sometimes Base64-wrapped for transport

Standard Base64 vs Base64URL

Standard Base64 uses +, /, and = padding. Those three characters conflict with URL syntax, so Base64URL substitutes - for +, _ for /, and drops the padding. JWT uses Base64URL. Always check which variant your consumer expects — decoding with the wrong variant silently produces garbage.

Encoding Unicode correctly

Base64 encodes bytes, not characters. For a string with non-ASCII characters (emoji, accented letters, CJK), encode to UTF-8 bytes first, then Base64 the bytes. The tool handles this automatically. Bugs creep in when legacy systems use btoa() in JavaScript directly on a Unicode string — that throws on any code point above U+00FF.

File and image encoding

Drop a file (PNG, PDF, anything) onto the tool and it returns the Base64-encoded content plus a ready-to-paste data URI. That's how you embed a logo directly in an HTML email template without hosting it anywhere, or inline a small icon into CSS.

Size overhead

Base64 encoding adds roughly 33% size overhead (4 output bytes per 3 input bytes). For small images or tokens this doesn't matter. For large files it does: a 10 MB Base64 string becomes ~13.3 MB. Don't Base64-encode video.

Related encoders

For URL parameters, use URL encoder/decoder (percent-encoding). For HTML entities, use HTML encoder/decoder. For cryptographic hashing (one-way, unlike Base64), use hash generator.

Featured Tools

Try these free tools directly in your browser — no sign-up required.

how to encode base64 base64 encoder online base64 decoder base64 to text base64 to image

Explore 300+ Free Tools

Utilko has tools for developers, writers, designers, students, and everyday users — all free, all browser-based.