Home › Developer Tools › Base64 Encode / Decode

Base64 Encode & Decode

Convert text to and from Base64 with full UTF-8 support, or turn a file into a Base64 data URI.

File to Base64

Choose any file to get its Base64 data URIFiles are processed in your browser and never uploaded.

Base64 is a way of representing binary data, or any text, using only 64 safe ASCII characters. It is used in email attachments, data URIs for embedding images in HTML and CSS, HTTP Basic authentication headers, JSON Web Tokens and many APIs.

This tool encodes text to Base64 and decodes Base64 back to readable text. It handles UTF-8 properly, so emoji and non-English characters survive the round trip. It also supports the URL-safe variant and can turn any file into a data URI.

How to use the Base64 Encode / Decode tool

  1. Paste text to encode, or a Base64 string to decode.
  2. Click Encode or Decode.
  3. Tick URL-safe if you need the -_ alphabet without padding, for example for JWTs or URLs.
  4. To encode a file, drop it in the File to Base64 box.

Features

  • Full UTF-8 support (emoji, Urdu, Arabic, Chinese…).
  • URL-safe Base64 encoding and decoding.
  • File to Base64 data URI conversion.
  • Tolerant decoding that ignores whitespace and data: prefixes.
  • Runs privately in your browser.

Tips for best results

Base64 is an encoding, not encryption: anyone can decode it, so never use it to 'hide' passwords. Base64 makes data about 33% larger, so embedding big images as data URIs can slow down a page. It's best used for small icons. To inspect a JWT, decode its middle part (the payload) with URL-safe decoding.

Compatibility and limits

The Base64 Encode / Decode tool is built for developers, testers, students and anyone who handles data. It runs in every modern browser, needs no installation or extension, and keeps working offline once the page has loaded. Because nothing is sent to a server, it's safe to use with production data, access tokens and internal configuration files.

Privacy: your files never leave your device

The data you enter is processed entirely in your browser with JavaScript. Nothing is sent to a server, which makes the tool safe for API responses, tokens, configuration files and other sensitive developer data.

Frequently asked questions

Is Base64 encryption?

No. It's a reversible encoding that anyone can decode, so it provides no security.

Why does decoded text look garbled?

The Base64 may contain binary data, such as an image, rather than text, or it may be corrupted.

What is URL-safe Base64?

A variant that uses - and _ instead of + and / and drops the = padding, so it can be used safely in URLs and file names.

Is my data uploaded?

No. Encoding and decoding happen in your browser.

Can I convert an image to Base64?

Yes. Drop it in the File to Base64 area to get a data URI you can use in HTML or CSS.