Base64 Encode & Decode

Encode text or a file to Base64, or decode Base64 back to readable text. It handles Unicode and URL-safe Base64, and works entirely in your browser.

Ad

File to Base64 (images, PDFs, any file)

Choose a file

or drop it here — converted to a data URI on your device

Text and files stay in your browser — never uploaded
Ad

How to encode or decode Base64

  1. Pick Encode to turn text into Base64, or Decode to turn Base64 back into text.
  2. Type or paste into the input box. The result updates as you type.
  3. Turn on URL-safe if the result goes into a URL or filename (it uses - and _ instead of + and /).
  4. To convert an image or other file, use File to Base64 below and copy the data URI.

What Base64 is and when to use it

Base64 represents any data using only 64 safe text characters (A–Z, a–z, 0–9, + and /), so binary data can travel through systems built for plain text: email attachments, JSON, HTML, CSS and URLs. Every 3 bytes become 4 characters, so the encoded text is about one third larger than the original.

Common uses are embedding a small image directly in HTML or CSS as a data: URI, sending a file inside a JSON API request, and reading the payload of a token such as a JWT (which uses URL-safe Base64).

Base64 is not encryption

Anyone can decode Base64 instantly; it provides no secrecy. Do not use it to hide passwords, keys or personal data. If you need to protect information, encrypt it with a proper tool, and treat a Base64 string of a secret as the secret itself.

Unicode, URL-safe Base64 and common errors

Ad

Frequently asked questions

How do I encode text to Base64?

Choose Encode, then type or paste your text. The Base64 result appears immediately and you can copy it. Unicode text is handled as UTF-8.

How do I convert an image to Base64?

Use File to Base64 below the main box: choose the image and copy the data URI (it starts with data:image/…;base64,). You can paste that straight into an HTML img src or a CSS url().

Is Base64 secure?

No. Base64 is an encoding, not encryption, and anyone can decode it. Never rely on it to protect secrets.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / and usually omits padding, so the string can be used in URLs, filenames and JWTs without escaping.

Are my text and files uploaded?

No. Encoding and decoding run in your browser, and files are read on your device only.

Ad