# Base64 Encoder and Decoder

> Base64 encodes arbitrary binary data as 64 safe ASCII characters so it survives systems that only handle text - email bodies, JSON payloads, data URIs and URLs. It is an encoding, fully reversible by anyone, and provides no security whatsoever.

Source: https://rankcert.com/tools/base64-encode-decode
Free, no signup. Updated: 2026-08-29

## How to use it

1. Choose encode or decode.
2. Paste your text or base64 string.
3. Copy the result - nothing is sent to a server.

## Questions

### Is base64 encryption?

No. It is an encoding, fully reversible by anyone. It provides zero security. Never use it to hide a secret.

### What is base64url?

A variant that replaces + with - and / with _ so the output is safe in URLs and filenames. JWTs use it. This tool accepts both on decode.

### Why does my decoded text look wrong?

Almost always a UTF-8 problem - naive atob returns a binary string and mangles anything outside ASCII. This tool decodes through TextDecoder, so accented and non-Latin characters come back intact.

### How much larger is base64?

About 33%. Three bytes become four characters, plus padding. That is why inlining large images as data URIs bloats a page.

### Why does base64 end in equals signs?

Padding. The encoding works in three-byte groups; when the input does not divide evenly, one or two = characters pad the final group. base64url usually omits them.

### When should I use a data URI instead of a file?

For images under about 2KB used above the fold, where the extra 33% is cheaper than a round trip. Anything larger is better as a real file the browser can cache.

### How do I encode base64 in the terminal?

base64 < file on macOS and Linux, base64 -d to decode. Add -w 0 on GNU coreutils to stop it wrapping lines.

### Is base64 the same as encryption or hashing?

No to both. Encryption needs a key and hashing is one-way. Base64 needs neither and reverses in a single step - it hides nothing from anyone.

## Related tools

- [CSV to JSON](https://rankcert.com/tools/csv-to-json): Turn a CSV into an array of JSON objects in your browser, with proper handling of quoted fields, embedded commas and custom delimiters.
- [JSON to CSV](https://rankcert.com/tools/json-to-csv): Convert a JSON array into a CSV you can open in Excel or Google Sheets, with headers taken from every key that appears.
- [Password Generator](https://rankcert.com/tools/password-generator): Generate strong random passwords in your browser using the Web Crypto API, with an entropy figure so you can see how strong they actually are.
- [JWT Decoder](https://rankcert.com/tools/jwt-decoder): Paste a JSON Web Token to decode its header and payload and read every claim, including expiry. Runs entirely in your browser.
- [JSON Formatter](https://rankcert.com/tools/json-formatter): Format, validate and minify JSON in your browser. Get the exact line and column of a syntax error instead of a vague parse failure.
- [UUID Generator](https://rankcert.com/tools/uuid-generator): Generate cryptographically random UUID v4s, or time-ordered UUID v7s that index far better as database primary keys.