365tools

Base64 Encoder / Decoder

Encode text and files to Base64, or decode Base64 back to text. URL-safe mode supported. All processing is local.

Files processed in your browser — never uploaded

Plain text

Base64

How Base64 Encoder / Decoder Works

1

Choose mode & paste

Select Encode or Decode. Paste your text into the left panel, or use the file button to encode any file directly to Base64.

2

Result appears instantly

The output updates as you type. Switch modes with the toggle — the Swap button flips output back to input so you can chain operations.

3

Copy or download

Copy the encoded or decoded result to clipboard with one click. In decode mode you can also download the result as a .txt file.

Key Features

Encode & Decode

Switch between encode and decode with one click. The output updates as you type — no need to click a button.

File encoding

Encode any file (image, PDF, binary) to a Base64 data URL — useful for embedding files in HTML, CSS, or JSON.

URL-safe mode

Toggle URL-safe Base64 which replaces + with - and / with _ and strips = padding — safe for use in URLs and filenames without escaping.

Swap output to input

The Swap button puts the current output back into the input and flips the mode — useful for quickly round-tripping an encode/decode.

100% browser-based

Uses the browser's built-in btoa() and atob() functions. Nothing is ever transmitted over the network.

Live preview

The encoded or decoded output updates instantly as you type. Encoding is near-instantaneous even for large inputs.

Frequently Asked Questions

Q
What is Base64 encoding?
A
Base64 is an encoding scheme that converts binary data into ASCII text using 64 printable characters (A-Z, a-z, 0-9, +, /). It is used to transmit binary data over text-only channels, embed images in HTML/CSS, and pass binary data in JSON or URLs.
Q
What is URL-safe Base64?
A
Standard Base64 uses + and / which have special meanings in URLs. URL-safe Base64 replaces + with - and / with _, and omits = padding, making the output safe for URLs and filenames without percent-encoding.
Q
Is my data sent to a server?
A
No. This tool uses the browser's built-in btoa() and atob() functions. All encoding and decoding happens locally in your browser tab.
Q
Can I encode files to Base64?
A
Yes. Click 'Encode file' to select any file. The tool reads it into browser memory and produces a Base64 data URL (data:[mime];base64,[data]) suitable for embedding in HTML or CSS.
Q
Why does my Base64 string end with == or =?
A
Base64 encodes every 3 bytes into 4 characters. If the input length is not a multiple of 3, = padding is added. One = means the last group had 2 bytes; == means it had 1 byte. URL-safe mode strips this padding.

More Developer Tools