This tool runs entirely in your browser. No data is sent to any server.

Free Base64 Encoder & Decoder — Text & Files, No Upload

Works offline No uploads No account GDPR-safe

What Is Base64 Encoding?

Base64 is a binary-to-text encoding scheme that converts arbitrary binary data into a string of 64 printable ASCII characters (A–Z, a–z, 0–9, +, and /). Every 3 bytes of input become 4 characters of Base64 output, making the encoded form about 33% larger than the original.

Text Encoding Use Cases

  • API authentication headers — HTTP Basic Auth sends credentials as Authorization: Basic base64(username:password).
  • JWT tokens — The header and payload parts of a JSON Web Token are Base64URL-encoded (a URL-safe variant of Base64).
  • JSON payloads — Embedding binary blobs or structured data inside JSON string fields.
  • Email encoding (MIME) — Email protocols were designed for ASCII text, so binary content is Base64-encoded before transmission.

File Encoding Use Cases

  • CSS background images — Embed images directly in stylesheets as background-image: url('data:image/png;base64,…') to eliminate extra HTTP requests.
  • Custom web fonts — Embed @font-face fonts as Base64 data URIs so they load with the CSS, no separate font request needed.
  • REST API file uploads — Send files inside a JSON body ({ "file": "base64string…" }) when multipart/form-data is inconvenient.
  • PDF email attachments — Many email APIs (SendGrid, Mailgun, etc.) accept attachments as Base64-encoded strings in the API payload.
  • SVG in HTML attributes — Embedding SVG icons as Base64 data URIs directly in <img src="data:image/svg+xml;base64,…">.

Supported File Types

This tool supports encoding and decoding any non-video file, including:

  • Images: PNG, JPG, GIF, WebP, SVG, ICO
  • Documents: PDF, DOCX, XLSX, PPTX
  • Audio: MP3, WAV, OGG
  • Fonts: WOFF2, WOFF, TTF
  • Data: CSV, JSON, XML
  • Archives: ZIP

Video files are excluded because they are typically very large and would produce Base64 strings that could crash your browser tab.

Privacy & Security

This tool is designed with a single privacy principle: your data never leaves your device.

  • No file uploads — Files are read using the browser's built-in FileReader API. Nothing is transmitted to any server.
  • No server logs — There is no backend processing. The server only serves the HTML page; all encoding and decoding happens in JavaScript on your machine.
  • Works offline — Once the page has loaded, you can disconnect from the internet and the tool will continue to work.
  • GDPR-safe — No personal data is collected, processed, or stored. No cookies are set by this tool. No analytics are attached to your input.

You can verify this yourself by opening your browser's DevTools Network tab — no requests are made when you click Encode or Download.

How It Works in Your Browser

Text encoding uses the browser's native btoa() and atob() functions with TextEncoder for full UTF-8 support. File encoding uses the FileReader.readAsDataURL() API, which reads the file into memory as a Base64 data URI — the same format browsers use internally for inline images and fonts. File decoding reverses this: it converts the Base64 string back to binary bytes using atob(), wraps them in a Blob, and triggers a browser download — all without touching a server.

Built by TuringComplete
Check out our open-source developer tools.
Explore Tools