HandyTools Hub

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 to text. Supports UTF-8.

Try it with a real conversion

Encode text, not a password

Text to encode

hello

Base64 result

aGVsbG8=

Base64 is not encryption

Anyone can decode Base64. Do not use it to protect passwords, tokens, or other secrets.

Read how Base64 works

This Base64 encoder and decoder converts text to Base64 and back, with full UTF-8 support for international characters. It’s for developers embedding data in URLs or HTML, debugging API payloads, handling Basic Auth headers, or anyone who has found a mysterious aGVsbG8= string and wants to know what’s inside.

How to Use

  1. Enter text: Type or paste your text into the input field
  2. Encode or decode: Click “Encode” to convert to Base64, or “Decode” to convert back — stray whitespace is handled automatically
  3. View the result: The converted text appears instantly in the output field
  4. Copy: One click sends the result to your clipboard

Features

  • Encode text to Base64 — convert any text, including Chinese, emoji, and other Unicode content
  • Decode Base64 back to text — invalid input is caught and reported clearly
  • Full UTF-8 support — multi-byte characters survive the round trip intact
  • Handles inputs up to 1MB — headroom for real-world payloads
  • One-click copy — grab results without manual selection
  • 100% client-side — your data never leaves the browser

How Base64 Works

Base64 exists because many systems — email above all — were designed to carry only printable ASCII text. Binary files like images break when pushed through channels that mangle or reject non-text bytes. Base64 solves this by taking every 3 bytes (24 bits) of input and re-splitting them into four 6-bit groups, each mapping to one of 64 safe characters: A–Z, a–z, 0–9, +, and /. When the input doesn’t divide evenly into 3-byte chunks, = characters pad the final group.

The trade-off is size: 3 bytes become 4 characters, so output is always about 33% larger. That’s why you shouldn’t Base64 large images into CSS — a 300KB photo becomes a 400KB stylesheet that blocks rendering and can’t be cached separately.

Base64 Is Not Encryption

This is worth repeating because it’s a genuinely common security mistake: Base64 is a representation, not a protection. Decoding requires no key — anyone can reverse it instantly, as this tool demonstrates. Basic Auth credentials are Base64-encoded, which is fine only because HTTPS encrypts the connection. Storing a password as Base64 hides it from nobody. If you need confidentiality, use real encryption; if you need integrity, use a hash or signature.

Use Cases

  • Data URLs: Embed small images or icons directly in HTML and CSS
  • Basic Auth: Encode username:password pairs for HTTP Authorization headers
  • API debugging: Decode Base64 payloads from JWTs, webhooks, and API responses
  • Email and JSON: Safely carry binary or special-character data through text-only formats

Frequently Asked Questions

What is Base64?

Base64 is a binary-to-text encoding scheme that represents binary data as ASCII text, using 64 safe characters (A-Z, a-z, 0-9, +, /).

Is Base64 encryption?

No, Base64 is encoding, not encryption. It's easily reversible by anyone and provides no security.

Why does Base64 output end with = signs?

The equals signs are padding. Base64 processes data in 3-byte groups producing 4 characters each; when the input length isn't a multiple of 3, one or two = characters pad the final group.

Why is Base64 output larger than the input?

Base64 encodes 3 bytes into 4 characters, so output is about 33% larger than the original data — the price of representing binary data using only text-safe characters.