Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text, with full Unicode support and URL-safe mode.

Convert a file to Base64

How to encode or decode Base64

  • Encode: type or paste text, then click Encode to get its Base64 form.
  • Decode: paste Base64 and click Decode to get the original text.
  • Files: choose any file to get a data: URI you can use in HTML or CSS.

Text is encoded as UTF-8, so accented letters, non-Latin scripts and emoji work correctly. Many simple Base64 tools break on these characters.

Example

The text Hello encodes to SGVsbG8=. The = at the end is padding that makes the length a multiple of 4.

Common uses of Base64

  • Embedding small images directly in HTML, CSS or emails
  • HTTP Basic authentication headers
  • JSON Web Tokens (JWTs), which use URL-safe Base64
  • Storing binary data in JSON or XML

Frequently asked questions

What is Base64?

Base64 is a way to represent any data, such as text or files, using only 64 safe characters (A–Z, a–z, 0–9, + and /). It's used to embed images in HTML and CSS, attach files to emails, and send binary data through systems that only handle text.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode it instantly, so never use it to protect passwords or private data.

What is URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 replaces them with - and _ and usually drops the = padding. It's used in JSON Web Tokens (JWTs) and web addresses.

Why is Base64 output longer than the input?

Base64 turns every 3 bytes into 4 characters, so encoded data is about 33% larger than the original.