Skip to content
WebUtilityHub

Base64 Encoder / Decoder

Convert text to Base64 and back. Accents, non-Latin scripts and emoji are handled correctly, and invalid Base64 is explained rather than silently garbled.

Action
Encoding options

How to use the Base64 Encoder / Decoder

  1. Choose “Encode text to Base64” or “Decode Base64 to text”.
  2. When encoding, choose whether you need the URL-safe alphabet and “=” padding.
  3. Type or paste your input. The result and its size in bytes update as you type.
  4. Copy the result, or swap input and result to check the round trip.

Examples

Encode text with an accent
Input
Hello, café!
Result
SGVsbG8sIGNhZsOpIQ==
Encode an emoji with the URL-safe alphabet, no padding
Input
😀
Result
8J-YgA
Standard Base64 would be “8J+YgA==”.
Decode Base64 that was split across lines
Input
SGVsbG8g
d29ybGQ=
Result
Hello world

Encoded size

The figure under the editors shows the size of your text in UTF-8 bytes. Plain English letters take one byte each, accented Latin letters usually two, most Asian characters three, and emoji four. The Base64 output is always about four characters for every three bytes, rounded up.

Padding

Base64 works in groups of three bytes. When the data does not divide evenly, the output is padded with one or two “=” signs so its length is a multiple of four. Some formats, such as JWT, drop the padding; turn off “Keep = padding” for those. The decoder works either way.

Base64 is not the same as URL encoding. To make text safe for a link while keeping it readable, use the URL Encoder. If the decoded text is JSON, such as a JWT payload, format it with the JSON Formatter.

Common uses

  • Reading Base64 values in API responses, JWT payloads, emails and configuration files.
  • Encoding text for HTTP Basic authentication headers or data: URLs.
  • Storing text with special characters in systems that only accept ASCII.
  • Checking whether a Base64 string contains readable text.

Limitations

  • This tool works with text. Files and binary data such as images or PDFs are detected and reported but not displayed.
  • Text is always encoded as UTF-8. Base64 that was made from text in another encoding (such as Windows-1252) cannot be decoded as text.
  • Base64 is an encoding, not encryption. Anyone can decode it, so never rely on it to hide passwords or secrets.
  • Very large inputs (tens of megabytes) may be slow on phones.

Frequently asked questions

What is Base64?

Base64 represents any data using 64 safe characters — A–Z, a–z, 0–9, “+” and “/” — plus “=” for padding. Every 3 bytes of data become 4 characters, so Base64 is about 33% larger than the original. It is used to carry binary or non-ASCII data through systems designed for plain text, such as email and URLs.

Why does btoa() fail with accents or emoji, but this tool doesn't?

The browser's built-in btoa() only accepts characters with codes up to 255 and throws an error for “€”, Chinese characters or emoji. This tool first converts your text to UTF-8 bytes, which is the standard way to represent any character, and then encodes those bytes.

What is URL-safe Base64 (Base64url)?

Base64url replaces “+” with “-” and “/” with “_” so the result can be used in URLs and file names without further encoding. It is used in JSON Web Tokens (JWT), for example, usually without “=” padding. The decoder accepts both alphabets, with or without padding.

Why can't the tool decode my Base64?

The error message explains the problem. Common causes are characters that are not part of Base64 (for example a stray quote or a percent sign from URL encoding), truncated input, or data that is a binary file rather than text. Spaces and line breaks are ignored, and a “data:…;base64,” prefix is removed automatically.

Percent-encode or decode URLs, query parameters and form data, with full UTF-8 support.

Developer

Format, minify and validate JSON with precise error locations. Numbers and key order are preserved.

Developer

Generate one or many random UUID v4 values using your browser’s cryptographically secure generator.

Developer