Ad Space

Position: header

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings instantly. Supports full UTF-8 characters with input and output byte length display.

Developer Tool

Enter any text, including UTF-8 characters like emojis and accented letters

Enter text above to see the Base64 encoded output in real time

How to Use

  1. 1Enter or paste text into the input field.
  2. 2Click Encode to convert plain text to Base64, or paste Base64 and click Decode to get the original text.
  3. 3The result appears instantly in the output area.
  4. 4Copy the encoded or decoded result to your clipboard.

About This Tool

The Base64 Codec encodes text to Base64 and decodes Base64 strings back to readable text, with full UTF-8 support. Base64 encoding converts binary data into ASCII text, making it safe to transmit through systems that only handle text.

Developers encounter Base64 regularly: data URIs in CSS and HTML embed images as Base64 strings. API authentication headers use Base64-encoded credentials. JWT tokens contain Base64-encoded JSON payloads. Email attachments are Base64-encoded for transmission through SMTP.

This tool handles UTF-8 encoding correctly, which matters for international text. A simple btoa() call in JavaScript fails on non-ASCII characters like accented letters or emoji. This tool properly encodes and decodes the full Unicode range without errors.

Base64 encoding increases data size by approximately 33% — every 3 bytes of input produce 4 bytes of Base64 output. This is why it is used for encoding, not compression. Understanding this overhead helps you decide when Base64 is appropriate versus alternatives like URL encoding or hex encoding.

Tips & Best Practices

  • Base64 is encoding, not encryption. Never use it to "protect" sensitive data — anyone can decode it instantly. Use proper encryption (AES, RSA) for security.
  • When debugging JWT tokens, decode only the payload section (the middle part between the two dots) — the header and signature are separate Base64 segments.
  • If your decoded output shows garbled characters, the original text was likely encoded with a different character set (like Latin-1 instead of UTF-8).

Frequently Asked Questions

What is Base64 encoding?
Base64 is a binary-to-text encoding scheme that represents binary data as an ASCII string. It converts every 3 bytes of input into 4 characters from a set of 64 printable ASCII characters (A-Z, a-z, 0-9, +, /), with = used for padding. It is commonly used to transmit binary data over text-based protocols.
What are common use cases for Base64?
Base64 is used to embed images in HTML/CSS (data URIs), encode email attachments (MIME), store binary data in JSON or XML, pass data in URL query parameters, encode authentication credentials (HTTP Basic Auth), and transmit files through APIs that only support text.
What is URL-safe Base64?
URL-safe Base64 replaces the + and / characters with - and _ respectively, and typically omits the = padding. This prevents conflicts with URL-reserved characters. It is commonly used in JWT tokens, URL parameters, and file names. Standard Base64 may break URLs because + and / have special meanings in URLs.
Can I encode files with Base64?
Yes, any file (images, PDFs, etc.) can be encoded to Base64. However, Base64 increases the data size by approximately 33%, so it is best used for small files. This tool handles text input; for file encoding, you would typically use a programming language or a dedicated file-to-Base64 tool.
Is Base64 encryption?
No, Base64 is NOT encryption. It is an encoding scheme, which means it is fully reversible without any key or password. Anyone can decode a Base64 string back to its original form. Never use Base64 to protect sensitive data. For actual security, use proper encryption algorithms like AES or RSA.

Ad Space

Position: sidebar

Ad Space

Position: below-fold