Base64 Encoder & Decoder

Convert text to Base64 or decode Base64 back to text. Supports Unicode and URL-safe mode. Everything runs locally in your browser.

Base64 in one line: it turns any binary data into 64 safe ASCII characters (A–Z, a–z, 0–9, +, /) so text-only systems — email, JSON, URLs, HTML — can carry it safely. Encoding is not encryption: anyone can decode it back.

✅ Quick Answer

"Man" → TWFu. "Hello" → SGVsbG8=. "中文" → 5Lit5paH. "😀" → 8J+YgA==.

Rule of thumb: Base64 makes output about 33% larger than the input (3 bytes → 4 chars). Add = padding to reach a multiple of 4; use URL-safe mode (- and _, padding stripped) before putting a string in a URL or query parameter.

Try an example:
0input bytes
0output chars
—size ratio
—padding

Frequently Asked Questions

What is Base64 encoding used for?

Base64 encodes binary data into a safe ASCII text format using 64 characters. It is widely used to embed images in HTML or CSS, send binary data through text-only channels (like email or JSON APIs), and store complex data in simple strings.

What is URL-safe Base64?

Standard Base64 uses the +, / and = characters which are not URL-friendly. URL-safe Base64 replaces + with - and / with _, and strips the padding, producing strings that can be placed directly in URLs and query parameters.

Is the Base64 tool safe for sensitive data?

Yes. Encoding and decoding happen entirely in your browser. Nothing you paste is ever uploaded to a server, so it is safe to process tokens, private keys and personal data.

Does it support Unicode text like Chinese characters?

Yes. The tool handles UTF-8 Unicode correctly, so Chinese, Japanese, emoji and accented characters encode and decode without corruption.

Is Base64 the same as encryption?

No. Base64 is an encoding format, not encryption. Anyone can decode it, so never use Base64 to protect sensitive information — it is meant for data transfer, not security.

How do I Base64-encode an image into a data URI?

Read the image file as bytes, Base64-encode the bytes, then prefix the result with data:image/png;base64, (or the correct MIME type). The whole string can be placed directly in an <img> tag or a CSS url(). Base64 inflates the file by about 33%, so it is best for small icons rather than large photos.

Why does my Base64 string end with = or ==?

Base64 encodes 3 bytes into 4 characters. When the input length is not divisible by 3, the encoder pads the output with = to keep it a multiple of 4 — one = if a single byte is left over, two if two bytes remain. URL-safe Base64 drops this padding entirely, because = is not safe in query strings.

What is the difference between Base64 and Base64URL?

Base64URL is a URL-safe variant of standard Base64: + is replaced by -, / by _, and the = padding is removed. It is used in JWT tokens, OAuth, and anywhere the string will appear inside a URL, filename or query parameter. Everything else is identical, and both decode to exactly the same bytes.

How do I decode a JWT payload?

A JWT is three dot-separated segments: header, payload and signature. Each one is Base64URL-encoded JSON. Split the token on the dots, paste the header or payload part into this tool with URL-safe mode ticked, and the readable JSON comes back instantly. Decoding only reveals the contents — it does not verify the signature, so never trust a token just because you can read it.

Is Base64 bigger than the original file?

Yes — about 33% bigger. Every 3 bytes of input become 4 output characters (4 ÷ 3 ≈ 1.33), so a 100 KB image turns into roughly 133 KB of text, plus line breaks if your encoder wraps lines. That overhead is why data URIs make sense for small icons and fonts, not for large photos or videos.

Base64 Encoder & Decoder — Fast, Private Text Conversion

Base64 is everywhere: embedded images, API authentication tokens, encoded configuration values and email attachments. Our free tool converts text to Base64 and back in a single click, handling Unicode correctly and offering URL-safe mode for web use.

Why use our Base64 tool?

  • Encode and decode instantly — no waiting, no uploads.
  • Full Unicode support for Chinese, Japanese, emoji and more.
  • URL-safe mode for embedding in links and query strings.
  • 100% private — everything runs in your browser.
  • Completely free with no registration or usage limits.

Common uses for Base64

  • Embedding small images directly into HTML, CSS or JSON.
  • Encoding authentication tokens for API requests.
  • Decoding data from JWT parts, configuration files or email sources.
  • Transferring binary data through text-only channels.

Base64 quick reference

Plain text Base64 (standard) Base64URL Bytes → chars
ManTWFuTWFu3 → 4
HelloSGVsbG8=SGVsbG85 → 8 (=)
Hello, World!SGVsbG8sIFdvcmxkIQ==SGVsbG8sIFdvcmxkIQ13 → 20 (==)
中文5Lit5paH5Lit5paH6 → 8
😀8J+YgA==8J-YgA4 → 8 (==)

Every 3 bytes of input become 4 Base64 characters — that is why Base64 output is roughly 33% larger. Padding with = is dropped in URL-safe mode.

Whether you are a developer, a security researcher or just need to convert a string quickly, this Base64 encoder and decoder is fast, reliable and always free.

Working with encoded data? Pair this tool with the JSON Formatter for validating API payloads, the URL Encoder when a value must survive a query string, and the Password Generator before you store any secret. Base64 keeps data portable — these tools keep it correct.