Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 back to text. Works correctly with emoji and every language thanks to UTF-8, and supports URL-safe Base64.

Base64 output
Ctrl + Enter to run

Runs 100% in your browser — your data is never uploaded to our server.

What is Base64?

Base64 represents binary data using only 64 safe characters (A–Z, a–z, 0–9, + and /, with = as padding). It is used wherever binary or arbitrary text has to travel through systems that only handle plain text: email attachments (MIME), data URLs in HTML and CSS, HTTP Basic authentication headers, JSON Web Tokens, and API fields that carry files or keys. Base64 output is about 33% larger than the input.

Base64 is an encoding, not encryption — anyone can decode it. Do not use it to protect passwords or secrets.

Why UTF-8 matters

The browser’s built-in btoa() function fails on characters outside Latin-1, such as Hindi, Chinese or emoji. This tool converts text to UTF-8 bytes first, which is what servers, command-line tools (base64) and programming languages expect, so नमस्ते 👋 encodes and decodes correctly. When decoding, it tells you if the result is binary data rather than readable text.

URL-safe Base64 (base64url)

Standard Base64 uses + and /, which have special meanings in URLs. The URL-safe variant (RFC 4648 §5) replaces them with - and _ and usually drops the = padding. JWTs use this variant. The decoder accepts both forms automatically, and also ignores whitespace and data:...;base64, prefixes.

Example

Text

Hello, World!

Base64

SGVsbG8sIFdvcmxkIQ==

Frequently asked questions

Why does decoding show strange characters?

The Base64 data is probably a binary file (an image, PDF or compressed data) rather than text. The tool warns you when the decoded bytes are not valid UTF-8.

What does the = at the end mean?

It is padding that makes the length a multiple of 4. One = means the last group encoded 2 bytes; == means it encoded 1 byte.

Can I encode a file?

You can upload text files. For images or other binary files, use a dedicated file-to-Base64 tool.

Is my text uploaded?

No. Encoding and decoding happen in your browser.