ToolsDeveloper Tools › Base64 Encoder / Decoder

Base64 Encoder / Decoder — Free Online Tool

Encode text or files to Base64, or decode Base64 strings back to text or files. Supports URL-safe Base64. No signup, runs in your browser.

Everything runs in your browser. Your text and files are never uploaded or stored.
Input — Text
Output
Output will appear here.

About Base64 Encoder / Decoder

Base64 Encoder / Decoder is a free browser-based tool that converts text or files to Base64 and decodes Base64 strings back to their original form. Everything runs locally in your browser — no data is uploaded or stored. The tool supports standard Base64 (RFC 4648) and URL-safe Base64, and can encode any file up to 5 MB.

Common use cases

  • Inspect or construct JWT tokens — decode the header and payload segments, or encode a custom payload for testing.
  • Encode images or fonts as Base64 data URIs for embedding directly in HTML or CSS without extra HTTP requests.
  • Convert API keys, credentials, or binary data to a safe text format for embedding in JSON fields or HTTP headers.
  • Decode Base64-encoded email attachments (MIME) to check their content without downloading them.
  • Generate URL-safe Base64 tokens for use in query strings, OAuth state parameters, or short-lived links.

Frequently asked questions

What is Base64 encoding?

Base64 is a binary-to-text encoding scheme that represents binary data using 64 printable ASCII characters (A–Z, a–z, 0–9, +, /). It is used to safely transmit binary data — images, files, cryptographic keys — through text-only channels such as email bodies, JSON fields, and HTTP headers. The encoded output is approximately 33% larger than the original.

What is URL-safe Base64?

Standard Base64 uses + and / characters, which have special meanings in URLs and query strings. URL-safe Base64 (RFC 4648 §5) replaces + with - and / with _, and optionally strips the = padding characters. Use URL-safe Base64 for data embedded in URLs, JWT tokens, and web API parameters.

Does this tool send my data to a server?

No. All encoding and decoding runs entirely in your browser using JavaScript's built-in btoa() and atob() functions. Files are read locally via the FileReader API. Nothing is uploaded or stored.

Why does my Base64 output end with == or =?

Base64 encodes every 3 bytes of input as 4 characters. When the input length is not a multiple of 3, padding characters (=) are added. One trailing = means 1 byte of padding; two == means 2 bytes. Enable the URL-safe toggle to strip padding.

Can I decode a Base64 image back to a viewable image?

Yes. Paste the Base64 string into Decode mode and click Decode. The tool detects PNG, JPEG, GIF, and WebP by their magic bytes and shows a live preview plus a download button.

What is the 5 MB file size limit for encoding?

Base64 encoding expands data by roughly 33% — a 5 MB file becomes ~6.7 MB of Base64 text. The cap keeps output manageable in a browser textarea. For larger files, use `base64 -i file -o file.b64` on macOS/Linux or `certutil -encode file file.b64` on Windows.

Also try

Related tools

Live Developer Tools

JWT Decoder

Decode any JWT instantly — inspect header, payload, and expiry timestamps without a signing key. Free, nothing stored.

Open tool
Live Developer Tools

JSON Formatter & Validator

Format, validate, and beautify JSON instantly. Pretty-print with indentation or minify to one line. Free, runs in your browser.

Open tool
Live Developer Tools

Word Counter

Count words, characters, sentences, and paragraphs instantly. See reading time and keyword frequency. Free, in your browser.

Open tool
Live Developer Tools

Password Generator

Generate cryptographically secure passwords client-side. Set length, character classes, and exclusions. Nothing leaves your browser.

Open tool