Skip to main content
Toolgin57 tools

Base64 Encode / Decode

Loading…

About Base64 Encode / Decode

The Base64 Encoder / Decoder converts text to Base64 encoding or decodes Base64 strings back to plain text instantly. Supports standard Base64 and URL-safe Base64 (replacing + with - and / with _). Handles Unicode text correctly using UTF-8 encoding.

Base64 is used to encode binary data as ASCII text for safe transmission in email (MIME), embedding images in HTML or CSS data URIs, encoding credentials in HTTP Basic Auth headers, storing binary data in JSON or XML, and passing data in URLs.

Everything runs entirely in your browser using the atob() and btoa() Web APIs. Your data never leaves your device.

How to Use Base64 Encode / Decode

  1. Paste your text or Base64 string into the input.

  2. Select Encode (text → Base64) or Decode (Base64 → text).

  3. Optionally enable URL-safe mode for use in URLs.

  4. Copy the result.

Examples

Example — Encode text
Input
Hello, World!
Output
SGVsbG8sIFdvcmxkIQ==
Example — Decode Base64
Input
SGVsbG8sIFdvcmxkIQ==
Output
Hello, World!
Example — Encode URL
Input
https://example.com/path?q=hello world
Output
aHR0cHM6Ly9leGFtcGxlLmNvbS9wYXRoP3E9aGVsbG8gd29ybGQ=

Frequently Asked Questions

What is Base64 used for?

Base64 encodes binary or arbitrary data as printable ASCII text for safe transmission in systems that only handle text, such as email (MIME), HTTP headers, JSON, XML, and URLs.

Does it support URL-safe Base64?

Yes — URL-safe mode replaces + with - and / with _ so the output can be safely included in URLs and filenames without percent-encoding.

Does it handle Unicode and emoji?

Yes — text is encoded as UTF-8 before Base64 encoding, ensuring all Unicode characters including emoji are handled correctly.

Is Base64 encryption?

No — Base64 is encoding, not encryption. It does not provide any security. Anyone who sees a Base64 string can decode it instantly.

How do I embed an image in HTML using Base64?

Encode the image file as Base64, then use it as: <img src="data:image/png;base64,ENCODED_DATA_HERE">

Why is Base64 encoded data about 33% larger than the original?

Base64 represents every 3 bytes of data as 4 ASCII characters (4/3 ratio). This overhead is the trade-off for making binary data safe to transmit as text.