Base64 encoder/decoder

How to use the Base64 encoder/decoder

  1. Paste text or upload a file — the tool handles both.
  2. Pick direction: encode to base64 or decode from base64.
  3. Toggle URL-safe base64 (replaces + and / with - and _) for use in URL query parameters.
  4. Copy the output, or download a decoded binary file.

When to use it

Use base64 when you need to transmit binary data through a text-only channel — embedded SVG in CSS (data:image/svg+xml;base64,…), JWT payloads, email attachments (MIME). Don't use it for compression: base64 inflates data by ~33%. For in-HTML inlining, it can eliminate an HTTP request but increases bytes on the wire.

Frequently asked questions

What's the difference between standard and URL-safe base64?
Standard uses + and /; URL-safe replaces them with - and _ so the output fits in URLs without further encoding. JWT tokens use URL-safe base64.
Why does my decoded file have extra bytes?
Base64 encoding is padding-sensitive — output length is always a multiple of 4 bytes, padded with =. The padding is part of the format; decoders strip it automatically.
Is base64 encryption?
No. Base64 is encoding, not encryption. Anyone can decode it trivially — never use it to 'hide' passwords or secrets.
Can I encode an image file to base64 for CSS?
Yes — upload a PNG/SVG/JPG, copy the output, and use it as data:image/png;base64,XXX in a background-image URL. Keep images under ~10 KB; larger files should stay external.

Related tools

Last updated: 2026-04-22