Base64 Encoder/Decoder

Runs in your browserDeveloper Tools#Encoding

Encode text or files to Base64 and decode it back to text or files, including URL-safe Base64.

How to use, limits & privacy

About Base64 Encoder/Decoder

Encode text or any file to Base64, and decode Base64 back to text or to the original file. The result updates as you type. Decoding accepts standard and URL-safe Base64, data: URIs, line breaks and missing padding, and when the result is a file (an image, PDF or ZIP) you get a download instead of garbled text. Everything runs in your browser, which makes it handy for developers, API testing and email or web work.

How to Use

1

Choose Encode or Decode

Encode turns text or a file into Base64. Decode turns Base64 back into text or a file.

2

Type, paste or drop

Type or paste into the box, click Example to try it, or drop a file on "Or encode a file". The result appears as you type.

3

Set the options

Turn on URL-safe for links and tokens, or Wrap at 76 characters for email (MIME). For a file, data: URI adds the prefix that HTML and CSS need.

4

Copy, download or swap

Copy or Download the result, or click Swap to decode what you just encoded. Decoded files show their type and a Download button.

Privacy & Processing

  • Mode: local
  • Files Leave Browser: Local tool processing; review details below
  • Max Input Size: Device memory limits
  • Account Required: No
  • Data Stored Locally: Nothing is saved; clearing the box or closing the page removes your input.
  • Network Processing: Assets or models may require an initial download

Text and files are encoded and decoded in your browser. Nothing is uploaded.

Rules & Limitations

  • Files up to 20 MB. Base64 is about a third larger than the original.
  • Very long results show the first 200,000 characters in the box; Copy and Download include all of it.
  • Text is encoded as UTF-8, so Hindi, other Indian scripts and emoji work.
  • URL-safe output uses - and _ and leaves out the = padding, as JWTs and most URL-safe APIs expect.
  • Base64 is an encoding, not encryption: anyone can decode it.

Top Suggestions

  • Decoding a Base64 value from an API response, a config file or an email header
  • Turning a small image, font or PDF into a data: URI for HTML or CSS
  • Making URL-safe Base64 for tokens and query strings
  • Getting a file back from a Base64 string, such as an attachment in JSON
  • Checking what a Basic Authorization header contains

Base64 Encoder/Decoder FAQ

How do I decode a Base64 string?

Click Decode and paste the string. The decoded text appears at once. If the Base64 holds a file such as a PNG or PDF, the tool names the file type and shows a Download button instead.

How do I convert a file to Base64?

Stay on Encode and drop the file on "Or encode a file", or click it to browse. Any file type up to 20 MB works. Turn on data: URI if you want to paste the result into an img src or a CSS url().

What is URL-safe Base64?

It is Base64 with - and _ in place of + and /, usually without the = padding, so it can sit in a URL or a JWT unchanged. This tool reads both kinds automatically when decoding.

Why does my decoded text look garbled?

Because the data is a file, not text. This tool checks whether the bytes are valid UTF-8 text; if not, it offers the file as a download with the right extension instead of showing garbled characters.

Is Base64 encryption?

No. Base64 only changes how data is written so it can travel as text. Anyone can decode it, so never use it to hide passwords or personal data.

Are my text and files uploaded?

No. Encoding and decoding happen in your browser and nothing is sent to a server. You can disconnect from the internet after the page loads and it still works.