CleanThisText guide

Base64 for UTF-8 text

Understand UTF-8 bytes, size overhead, and the limits of a text-only Base64 decoder.

Base64 is representation, not secrecy

Base64 maps bytes to printable characters. Anyone holding the encoded string can decode it, so it does not encrypt passwords, tokens, or documents. Use it when a system specifically requires a text representation of bytes.

This encoder converts input to UTF-8 first so accented letters and emoji can round-trip. Treating each JavaScript character as a single byte is not sufficient for arbitrary Unicode text.

Check the alphabet and payload

The decoder accepts the standard Base64 alphabet, with required padding, and ignores whitespace. It then reads the resulting bytes as UTF-8. An encoded image or archive is binary data and may produce an error rather than readable text.

URL-safe Base64 uses a different alphabet and often omits padding; this decoder does not silently adapt every variant. A data URL's prefix is not part of the encoded payload either; supply only the data after its comma.

Allow for expansion

Three input bytes become four Base64 characters, with padding for an incomplete group. Base64 is generally larger than its input, not a compression technique. A non-ASCII character can already occupy several UTF-8 bytes before that expansion.

For an integration problem, verify the alphabet, padding, source encoding, and whether the receiver expects text or binary. Preserve the original until a round trip returns exactly the expected text.

Worked example

Input

Café

Result

Q2Fmw6k=

The accented letter is first represented as UTF-8 bytes. The decoder returns the same text.

Open Base64 Encoder

For the next step

Simple hardware for an offline draft workflow.

Optional picks for moving paper notes into a file and writing through a revision.

MUNBYN portable scanner product photo

MUNBYN portable scanner

A handheld scanner option for bringing paper notes and pages into a digital workflow.

View on Amazon
GLENCREAG RK104 retro mechanical keyboard product photo

GLENCREAG RK104 retro mechanical keyboard

A full-size mechanical keyboard option for long cleanup, formatting, and writing sessions.

View on Amazon

As an Amazon Associate I earn from qualifying purchases.

All referenced CleanThisText tools process pasted text locally in browser memory. Read the privacy explanation.

Use the related tools