Base64 Encoder / Decoder

Encode text to Base64 or decode Base64 to plain text. Supports Unicode and URL-safe Base64. Works entirely in your browser.

0 characters
0 characters

What is Base64?

Base64 is an encoding scheme that converts binary data into a string of ASCII characters. It uses 64 characters (A-Z, a-z, 0-9, +, /) plus = as padding. It is commonly used to embed binary data (images, files) in text formats like JSON, HTML, CSS, and email.

Standard Base64
Characters: A–Z, a–z, 0–9, +, /
Used in email (MIME), data URIs, and most general encoding. Padding character is =.
URL-safe Base64
Characters: A–Z, a–z, 0–9, -, _
Replaces + with - and / with _ so the output is safe inside URLs and filenames without percent-encoding.

Common uses of Base64

Data URIs

Embed images directly in HTML or CSS as data:image/png;base64,... to reduce HTTP requests.

JWT Tokens

JSON Web Tokens use URL-safe Base64 to encode the header and payload sections of the token.

API Credentials

HTTP Basic Auth sends username:password encoded in Base64 in the Authorization header.

Frequently asked questions

Is Base64 encryption?

No. Base64 is encoding, not encryption. Anyone can decode a Base64 string without a key. It is used to safely transport binary data in text channels, not to keep data secret.

Why does Base64 output end with == or =?

Base64 encodes 3 bytes at a time into 4 characters. If the input length is not a multiple of 3, padding (= signs) is added so the output length is a multiple of 4.

How does Unicode handling work here?

JavaScript's btoa() only handles Latin-1 characters. This tool uses encodeURIComponent + escape before encoding to handle the full Unicode range correctly, including emoji and Indian language characters.

What is the size increase after encoding?

Base64 encoded output is approximately 33% larger than the original. 3 bytes of input become 4 characters of output.

Can I encode files with this tool?

This tool encodes text (strings). To encode binary files (images, PDFs) you would need a file reader — a future version of this tool may support file input. For now, paste text or JSON content.