Encode / Decode

Base64 Encoder & Decoder

Encode text or files to Base64, or decode Base64 strings back to readable text — with full Unicode support.

Base64
Output will appear here

Base64 encode and decode online

Base64 turns arbitrary binary or text data into a printable, ASCII-safe string. It's used to embed images directly in CSS/HTML (data: URIs), attach binary payloads inside JSON or XML, encode credentials in HTTP Basic Auth headers, and safely transmit binary data through text-only channels like email (MIME).

How this tool handles Unicode

Naively using btoa()/atob() breaks on non-ASCII text (accented characters, emoji, CJK text). This tool encodes text as UTF-8 bytes first, so international text round-trips correctly — paste text with emoji or accented characters and it will encode and decode without corruption.

Typical use cases

  • Embedding small images: Convert a small icon or logo to a Base64 data: URI to inline it in CSS or HTML.
  • API payloads: Some APIs expect binary attachments (like a PDF or image) encoded as a Base64 string inside JSON.
  • Debugging HTTP Basic Auth: Decode an Authorization: Basic ... header to see the underlying username:password value.
  • Inspecting JWTs and tokens: Many tokens use Base64/Base64URL encoding for their segments.

For a deeper explanation of how Base64 actually works under the hood, see What Is Base64 Encoding and Why Do We Need It?

Frequently Asked Questions

Yes. Text is encoded as UTF-8 bytes before Base64 encoding, so accented characters, emoji, and non-Latin scripts round-trip correctly, unlike a plain btoa() call.
Yes — use the file upload field to convert any file (image, PDF, etc.) into a Base64 string, for example to build a data: URI.
Base64URL replaces the + and / characters with - and _ and typically omits padding, making it safe to use inside URLs and filenames. This tool uses standard Base64; for Base64URL-encoded tokens like JWTs, use the dedicated JWT Decoder tool.
No. Base64 is an encoding, not encryption — it provides no confidentiality. Anyone can decode it instantly. Never use Base64 alone to protect sensitive data.
No. All encoding and decoding, including file conversion, happens locally in your browser.