Base64 Encoder & Decoder

Encode text or files to Base64 — or decode Base64 strings back to text. Auto-detection, image preview, and file support. Runs entirely in your browser.

Type or paste text — converts as you type

Input

Outputread-only

About this tool

A fast, privacy-first Base64 tool that works offline. Switch between Encode, Decode, and Auto Detect modes — the output updates instantly as you type. Use the File tab to convert any file to Base64, useful for embedding images in CSS data URLs or sending binary data over text-based APIs.

When decoded output contains an image, a live preview appears automatically. Your data never leaves your device.

How to use

1

Choose a mode

Select Encode to convert text to Base64, Decode to convert Base64 back to text, or Auto Detect to let the tool decide.

2

Enter text or upload a file

Type or paste content in the Text tab for string encoding. Switch to the File tab to upload any file type and convert it to Base64.

3

See the result

The output appears instantly as you type. If the decoded output is an image, a live preview is shown automatically.

4

Copy or Download

Click Copy to copy the result to clipboard, or Download to save the output as a file.

Frequently asked questions

Common questions about Base64 encoding and decoding.

No. All encoding and decoding happens entirely in your browser using the built-in btoa() and atob() functions. Nothing is ever sent to a server.

Base64 is a binary-to-text encoding scheme that represents binary data as ASCII characters. It is widely used to embed images in HTML or CSS, send binary data over text-based protocols like JSON or XML, and store binary content in text files.

If the Base64 string encodes binary data — such as an image, PDF, or compiled file — the decoded output will appear as unreadable characters since it is binary, not text. Use the File tab to work with binary files.

Yes. Switch to the File tab to upload any file type. It will be read in your browser and converted to a Base64 string you can copy or download.

Auto Detect inspects your input to decide whether to encode or decode. If the input matches the pattern of a valid Base64 string (correct character set and length divisible by 4), it decodes it. Otherwise it treats the input as plain text and encodes it.