How to Base64 encode text or a file

Base64 turns binary or text into an ASCII string safe for URLs, JSON and data URIs. Here's how to encode and decode it.

Open Base64 Encoder

Steps

  • Open the Base64 encoder and paste text or drop a file.
  • The Base64 string (or data URL) is produced instantly.
  • Copy it, or switch to the decoder to reverse the process.

Unicode and files

Text is UTF-8 encoded before Base64, so emoji and non-Latin characters round-trip correctly. Files become data URLs you can inline directly in HTML or CSS.

Tools used in this guide

Related guides

How to Base64 encode text or a file — FAQ

It encodes binary or text as ASCII so it's safe to embed in URLs, JSON, and data URIs.