# Base64 Encoder & Decoder

> Encode and decode Base64 with automatic direction detection, plus file and data-URI support.

To encode or decode Base64, paste your text — the direction is detected automatically, so valid Base64 is decoded and anything else is encoded. Files can be encoded too, producing a ready-made data URI. Encoding is UTF-8 safe, so emoji and non-Latin scripts survive the round trip.

**URL:** https://convertto.tech/t/base64-encode-decode
**Category:** Encoders & Decoders (https://convertto.tech/c/encoding-tools)
**Privacy:** Runs entirely in the browser; no upload
**Cost:** Free, no sign-up
**Last updated:** 2026-08-01

## Key facts

- **Direction:** Detected automatically
- **Inputs:** Text or any file up to 25 MB
- **Variants:** Standard and URL-safe (base64url)
- **Overhead:** Roughly 33% larger than the source
- **Privacy:** Runs entirely in your browser — nothing is uploaded
- **Cost:** Free, unlimited, no sign-up

## How to use

1. Choose the input.
2. Enter or paste your text or base64.
3. Select your file — the file stays on your device and is never uploaded.
4. Choose the direction.
5. Turn "URL-safe (base64url)" on or off as needed.
6. Press Run, then download the result when it is ready.

## FAQ

### Is Base64 encryption?

No. Base64 is an encoding, not encryption — anyone can decode it instantly. It exists to move binary data through text-only channels, not to protect it.

### What is base64url?

A variant that replaces + with - and / with _ and drops padding, so the result is safe inside URLs and filenames. JWTs use this variant.

### How does auto-detection decide?

It checks whether the input is syntactically valid Base64 and whether decoding it produces mostly printable characters. Plain text that happens to look like Base64 fails that second test and is encoded instead.

### Why is my Base64 bigger than the file?

Base64 represents every three bytes as four ASCII characters, so output is always about 33% larger. That is the cost of making binary data safe for text-only channels.

## Sources

- [RFC 4648 — The Base16, Base32, and Base64 Data Encodings](https://www.rfc-editor.org/rfc/rfc4648) — IETF

## Related tools

- [Data URI Generator](https://convertto.tech/t/data-uri-generator): Turn text, SVG or CSS into a data: URI you can inline directly in HTML or stylesheets.
- [File to Base64 Converter](https://convertto.tech/t/file-to-base64): Encode any file — image, PDF, video, font, archive — as Base64, a data URI, hex or a byte array.
- [Base64 to File Converter](https://convertto.tech/t/base64-to-file): Decode Base64, a data URI or hex back into a downloadable file, with the type detected automatically.
- [PDF to Base64 Converter](https://convertto.tech/t/pdf-to-base64): Encode a PDF as a Base64 string or a data URI, ready to embed in code.
- [Base64 to PDF Converter](https://convertto.tech/t/base64-to-pdf): Decode a Base64 string into a real, downloadable PDF file.
- [Multi-Format Encoder](https://convertto.tech/t/multi-encoder): Encode text into Base64, hex, binary, URL, HTML entities, ROT13 and more, all at once.
- [Base32 Encoder & Decoder](https://convertto.tech/t/base32-encode-decode): Encode and decode Base32 (RFC 4648) — used by TOTP secrets and case-insensitive identifiers.
- [Base58 Encoder & Decoder](https://convertto.tech/t/base58-encode-decode): Encode and decode Base58 — the Bitcoin alphabet that omits look-alike characters.
