Base64 Encoder

Runs in browser Encoding

Convert UTF-8 text or uploaded files to Base64 with optional URL-safe alphabet, line wrapping and data-URI output. Fully client-side.

Privacy: This tool runs entirely in your browser. Your input never leaves your device.
Loading tool…

How to use Base64 Encoder

  1. Type text or choose a file.
  2. Pick URL-safe, padding and wrapping options as needed.
  3. Enable "data: URI" to embed the result in HTML or CSS.
  4. Copy or download the Base64 output.

Base64 Encoder features

  • Encodes UTF-8 text or a local file (up to 5 MB) — nothing is uploaded
  • Standard or URL-safe alphabet, with or without = padding
  • Line wrapping at 76 (MIME) or 64 (PEM) characters
  • data: URI output with automatic MIME type detection
  • Recognises common file signatures (PNG, PDF, ZIP…) in the details
  • Live encoding with size statistics

Base64 Encoder example

Encode Unicode text

Input:

Hello, MUTQAN TOOLS! مرحبا 🚀

Output:

SGVsbG8sIE1VVFFBTiBUT09MUyEg2YXYsdit2KjYpyDwn5qA

Frequently asked questions about Base64 Encoder

What is the difference between Base64 and Base64url?

Base64url (RFC 4648 §5) replaces "+" with "-" and "/" with "_" and usually drops the "=" padding, so the result is safe in URLs, file names and JWTs without percent-encoding.

How are non-English characters handled?

Text is first converted to UTF-8 bytes, so Arabic, Hindi, emoji and any other Unicode text round-trips correctly. Decoders must also read the bytes as UTF-8.

When should I use line wrapping?

MIME email bodies use 76-character lines and PEM files use 64. Data URIs, JSON values and HTTP headers must stay on one line — leave wrapping off there.

Does Base64 encrypt my data?

No. It is a reversible encoding that anyone can decode. Use it to transport binary data as text, never to hide secrets.

Why is the output longer than the input?

Every 3 bytes become 4 characters, so Base64 is about 33 % larger than the raw bytes (plus line breaks if wrapping is enabled).

Technical notes

Base64 (RFC 4648) maps every 3 input bytes to 4 characters from a 64-character alphabet; the final group is padded with "=". Text is converted to UTF-8 first, so the output is byte-exact and interoperable with atob/btoa (after UTF-8 handling), Buffer.from(..., "base64") and base64 command-line tools.