← Back to tools

Base64 Encode / Decode

Encode text to Base64 or decode Base64 back to plain text.

Input
Output
Input: 0 bytes Output: 0 bytes

Base64 encodes binary data into a text-safe format using 64 ASCII characters: A-Z, a-z, 0-9, +, and /. It's used whenever binary data needs to travel through text-only channels — email attachments (MIME), data URIs in CSS/HTML, JSON payloads, and API authentication headers.

The encoding works by taking 3 bytes (24 bits) of input and splitting them into 4 groups of 6 bits, each mapped to one of the 64 characters. This means Base64 output is roughly 33% larger than the original data. The = padding character fills in when the input length isn't divisible by 3.

URL-safe Base64 replaces + with - and / with _ to avoid conflicts with URL query parameters. This tool supports both standard and URL-safe variants, and processes everything client-side using the browser's btoa() and atob() functions.

This tool in other languages:

Français:
Encodeur et décodeur Base64

Español:
Codificador y decodificador Base64

Deutsch:
Base64-Encoder und Decoder

Português:
Codificador e decodificador Base64

日本語:
Base64エンコーダー&デコーダー

中文:
Base64 编码解码工具

한국어:
Base64 인코더 및 디코더

العربية:
مشفر ومفكك Base64

Frequently asked questions

How do I encode text to Base64 online?

Paste or type your text in the input area and click Encode →. The Base64 output appears instantly in the output box. Click Copy Output to copy it. Supports Unicode (emoji, non-Latin characters) via UTF-8.

How do I decode Base64 back to text?

Paste your Base64 string into the input and click ← Decode. If the input is valid Base64, the decoded text appears instantly. Invalid input (bad padding, non-Base64 characters) will show an error so you can spot corrupted strings.

What is the difference between Base64 and URL-safe Base64?

Standard Base64 uses + and /, which have special meanings in URLs. URL-safe Base64 replaces them with - and _ and often omits padding (=). Use URL-safe Base64 for query strings, JWTs, and file paths.

Is Base64 encryption?

No. Base64 is an encoding, not encryption. Anyone can decode a Base64 string in seconds — it provides zero security. Base64 exists to represent binary data as ASCII text (for emails, URLs, JSON payloads), not to hide it. For actual security, use the Text Encryptor with a password.

Can I encode a file or image to Base64?

For images, use the dedicated Image to Base64 tool — it handles the binary-to-Base64 conversion and gives you a ready-to-paste data URI for CSS or HTML.