Base64 Encoder

Encode text or data to Base64, with an optional URL-safe alphabet. UTF-8 input is handled correctly and nothing is uploaded.

Text

Paste text to encode

Base64 output

Result

What is Base64 encoding?

Base64 turns binary data into plain ASCII characters so it can travel safely through channels that only accept text — JSON bodies, data URLs, email headers and config values. It is an encoding, not encryption: anyone can decode it.

This tool encodes text and files to Base64 and decodes Base64 back to text or a file, entirely in the browser. Files are read through the FileReader API and never transmitted.

How to encode or decode Base64

  1. Pick a mode: Encode to turn readable data into Base64, or Decode to turn Base64 back into readable data.
  2. Choose the source: Text for typed input, or File to load an image, document or any binary file from disk.
  3. Type or paste into the left pane, or select a file. The result updates in the right pane as you type.
  4. Optional: turn on URL-safe for URL and filename friendly output, Wrap at 76 for MIME-style line breaks, or data: URL prefix to embed the output in HTML or CSS.

Base64 examples

Plain text (UTF-8)

UrsaKit
VXJzYUtpdA==

URL-safe output

subjects?_d=1
c3ViamVjdHM_X2Q9MQ

Decode back to JSON

eyJvayI6dHJ1ZX0=
{"ok":true}

Base64 vs other encodings

DimensionBase64HexURL encoding
Size overhead~33% larger100% larger3–9% per escaped byte
Character setA–Z a–z 0–9 + / =0–9 a–fASCII with %XX escapes
Typical useBinary in JSON, data URLsHashes, byte dumpsQuery strings
Human readableNoNoPartly
FAQ

Base64 FAQ

Is Base64 encryption?

No. Base64 is a reversible encoding — anyone who has the string can decode it. Use real encryption if the content is sensitive.

Why is the output longer than the input?

Three bytes of input become four ASCII characters, so the encoded string is about 33% larger than the original.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meaning inside URLs. URL-safe Base64 replaces them with - and _ and drops the = padding so the string can sit in a query parameter or filename.

Does this tool upload my file?

No. Files are read in the browser with the FileReader API; nothing is sent to a server.

Can I decode a string without padding?

Yes. Missing = padding is restored automatically when the length is unambiguous, and both standard and URL-safe alphabets are accepted.

All Tools