Skip to content
Tool 02 / 04Runs locally

Base64 Encoder & Decoder

Encode text to Base64 or decode Base64 to text with full UTF-8 support. Toggle URL-safe Base64, convert live as you type, and catch malformed input instantly. Nothing leaves your browser.

Uses + and / · padded

Text is converted to UTF-8 bytes first.

0 chars · 0 bytes

Waiting for input.

0 chars · 0 bytes

Conversion happens in this tab. Nothing is uploaded.

Base64 is encoding, not encryption.

Under the hood

How it works

No black box: every transformation on this page is a documented browser API running on your device.

Base64 is an encoding, not encryption. It makes binary data safe to transport through text channels; anyone can decode it. Never use it to protect secrets.

  1. 01

    Encode UTF-8 first

    Text is converted to UTF-8 bytes with TextEncoder, then those bytes are mapped to the Base64 alphabet. This preserves emoji, accents, and every non-ASCII script.

  2. 02

    Validate before decoding

    The decoder checks alphabet characters, padding, and length before using atob. The resulting bytes are decoded with a fatal UTF-8 decoder, so invalid text produces a clear error instead of mojibake.

  3. 03

    Optionally go URL-safe

    URL-safe Base64 replaces + and / with - and _, and drops trailing padding. It is the variant used in JWTs, URLs, and filenames.

Common questions

Frequently asked

Short answers about how base64 works and where its limits are.

Is Base64 the same as encryption?

No. Base64 is reversible by anyone and offers no confidentiality. It is useful for embedding binary data in JSON, HTML, email, and URLs, but secrets must be encrypted with a real cryptographic tool.

Why does btoa fail on emoji or accented text?

btoa operates on binary strings and throws on characters outside Latin-1. This tool converts text to UTF-8 bytes with TextEncoder before encoding, so emoji and non-English text work correctly.

What is URL-safe Base64?

Standard Base64 uses + and /, which can have special meaning in URLs. URL-safe Base64 (RFC 4648 §5) substitutes - and _ and commonly omits = padding. This tool accepts either alphabet when decoding.

Why is my Base64 valid but not decoded as text?

Base64 can represent arbitrary binary data, not just text. If the decoded bytes are not valid UTF-8, the tool reports an error rather than showing corrupted characters.

All processing happens locally in your browser.

Your tool input is never uploaded. Google AdSense supports the site and may use cookies for advertising.

Browse all tools