Base64 Encoder/Decoder

Encode and decode Base64 strings, files, images with data URL support. Upload files or paste text for instant conversion.

Base64 Encoder/Decoder

Encode and decode Base64 text, files, and data URLs

Convert text/files to Base64 format

Characters: 0

Tips & Info

Free Base64 Encoder and Decoder Online

Base64 is an encoding scheme that converts binary data into a text-safe ASCII string. It is not encryption: it is a way to represent binary content (images, files, arbitrary bytes) in a format that can travel safely through text-based protocols like HTTP, JSON, email, and HTML attributes. Base64 increases data size by about 33%.

This free Base64 encoder/decoder handles text, file uploads, and images, including generating data URLs for embedding images directly in HTML or CSS without separate HTTP requests.

How to encode or decode Base64

  1. Choose Encode or Decode mode.
  2. Paste text or upload a file or image.
  3. The result appears instantly with size and overhead statistics.
  4. For decoded images, preview the result directly in the tool.
  5. Copy the output or download the decoded file.

Common developer use cases

  • CSS data URLs: Embed small icons and images directly in CSS with background-image: url("data:image/png;base64,...") to eliminate extra HTTP requests.
  • API file uploads: Encode a binary file (PDF, image) to a Base64 string for transmission in a JSON request body.
  • HTTP Basic Auth: The Authorization: Basic header encodes username:password as Base64.
  • JWT tokens: JWT header and payload are Base64URL encoded (Base64 with + replaced by - and / by _).
  • Email attachments: MIME uses Base64 to encode binary attachments in plain-text email messages.
  • HTML inline images: Use <img src="data:image/png;base64,..."> to embed images without separate file hosting.

Base64 vs Base64URL

Standard Base64 uses + and / as the last two characters, which are URL-unsafe. Base64URL replaces them with - and _ respectively, making the output safe for use in URLs and HTTP headers without percent-encoding. JWTs always use Base64URL encoding.

Free forever, no ads, no tracking. Support the project