Skip to main content

Base64 Encoder/ Decoder

Encode text to Base64 or decode Base64 back to text.

Select mode, enter text, and click Convert.

Base64 method, UTF-8 handling, and verification

Base64 represents binary data with a restricted text alphabet. It is encoding, not encryption: anyone who receives the output can decode it. This page converts text to UTF-8 bytes before Base64 encoding and reverses that process when decoding. That extra UTF-8 step matters because the browser’s basic btoa function accepts only byte-sized characters.

Methodology

  1. Encode mode converts the JavaScript string to UTF-8 bytes with TextEncoder.
  2. Each byte sequence is converted to the standard RFC 4648 Base64 alphabet with equals-sign padding when required.
  3. Decode mode validates and decodes the Base64 bytes, then uses TextDecoder to reconstruct UTF-8 text.
  4. The tool uses standard Base64, not the Base64url alphabet used by JWT segments. Plus and slash are therefore not automatically replaced.

Worked review example

ASCII input “hello” encodes to “aGVsbG8=”. Unicode input such as “你好” must first become its UTF-8 byte sequence; direct btoa use would throw an error or encourage a lossy workaround. Decode a known short value before processing a larger payload. If the source is a file rather than text, use a file-aware workflow so arbitrary binary bytes are not interpreted as UTF-8.

Test coverage and expected behavior

Test coverage includes empty input, ASCII, accented text, CJK characters, emoji, padding, malformed Base64, and a known RFC-style vector. Verification covers that valid UTF-8 samples survive encode then decode without changing the visible text. Invalid input produces an error instead of a fabricated result.

Decision checklist before using the output

Identify the payload type before conversion. Use this text page only when the source and expected result are UTF-8 text. For an image, archive, certificate, or other binary file, use a byte-preserving file encoder and compare a checksum after decoding. Confirm which alphabet the receiving system expects: standard Base64, Base64url, MIME-wrapped output, and unpadded forms are related but not interchangeable in every protocol. Preserve the original value and test a round trip with a small sample that includes non-ASCII characters when international text is possible. Do not paste API secrets, private keys, session tokens, or customer records merely to inspect them. Encoding does not reduce sensitivity. In integration code, rely on the platform’s maintained byte APIs and define the character encoding explicitly; a browser tool is most useful for diagnostics, documentation examples, and short non-sensitive payloads.

Important limitations

  • Base64 increases size and provides no confidentiality or integrity.
  • Standard Base64 and Base64url use different characters and padding conventions.
  • Decoded bytes that are not valid UTF-8 cannot be represented faithfully as text.
  • Never treat a successfully decoded JWT or credential-looking string as verified or safe.

Sources and specifications

These references define the relevant format or browser behavior. They do not endorse WordCaseFix.

Last reviewed: August 6, 2026