Base64 encoder & decoder

Encode or decode UTF-8 text locally with Standard or URL-safe Base64.

Enable JavaScript to encode or decode Base64 locally in your browser.

Local · no upload

Up to 200,000 UTF-16 units. Text clears when you leave or refresh.

Read only

UTF-8 text only. Base64 is encoding, not encryption.

Encode or decode text in three steps

  1. Choose Direction and Alphabet, then paste your text. Try example fills an empty input without converting it.
  2. Select Encode text or Decode Base64. If decoding fails, check the alphabet, padding and UTF-8 source.
  3. Review the output and select Copy result. If clipboard access fails, use Select result and copy it yourself.

Editing input or changing any setting clears the previous result, copy receipt and feedback receipt. Clear removes input and output. Text stays only in this page’s memory and clears when you leave or refresh. Copy it before opening another tool.

Standard Base64, URL-safe Base64 and strict validation

f → Zg== · foobar → Zm9vYmFy

Standard uses + and / with canonical = padding. URL-safe uses - and _ and encodes without padding; decoding accepts either omitted or canonical padding.

The alphabet must match your selection. Incorrect padding, internal = characters, mixed alphabets and non-zero unused pad bits are rejected. For example, Zg== is valid Standard Base64; Zh== is rejected. A one-character remainder cannot be decoded.

Encoding preserves spaces, tabs and line breaks. Decoding rejects whitespace by default. The optional setting removes only ASCII space, TAB, CR and LF; it does not remove NBSP, vertical tab, form feed, zero-width spaces or BOM.

UTF-8 decoding is strict: invalid byte sequences, overlong encodings, surrogate code points and truncated sequences fail instead of becoming replacement characters. A UTF-8 BOM is preserved as U+FEFF. Encoding rejects unpaired Unicode surrogates and does not normalize Unicode.

Input in either direction is limited to 200,000 UTF-16 units; output is limited to 800,000 units. An emoji may use two units. Over-limit content is rejected without truncation and the full input is preserved. A large encoded result can exceed the decode input limit, so not every text that can be encoded here can be pasted back to decode here.

The codec preserves CR and CRLF. Browser textarea input and display may normalize them to LF. Encoding uses the textarea value actually received; Copy result uses raw decoded text, while manual selection can use normalized line breaks. System clipboard behavior varies; this is not a byte-preservation guarantee.

Base64 is encoding, not encryption.

Base64 does not protect secrets. This tool handles UTF-8 text, not arbitrary binary files, images, data URLs, JWT parsing or signature verification. It does not fetch URLs, detect character sets or read your clipboard automatically. HTML is displayed as text and never executed.

Copy your text first, then open the JSON formatter or Inspect & Clean. Content is never transferred automatically between tools. Read about privacy and optional analytics.

Last reviewed: 2026-10-24