Text and data tool

Base64 Encoder & Decoder

Encode UTF-8 text to standard Base64 or decode it back to readable text. Everything runs in your browser.

Encode text to Base64 or decode Base64 back to UTF-8 text locally.

Action

The active action is applied with one click.

How to encode and decode Base64

Encode UTF-8 text

Enter text and choose Encode. The tool uses TextEncoder to convert every Unicode string to UTF-8 bytes, then represents those bytes with standard RFC 4648 Base64. Encoding is button-driven, not live while typing.

Decode standard Base64

Enter standard Base64 and choose Decode. The tool removes whitespace, validates and normalizes the encoded form, decodes its bytes, and returns text only when those bytes are valid UTF-8. Decoding is also button-driven.

Copy and Clear

Copy writes only the current output to the clipboard. Clear resets the current input, output, status, and error state.

Base64 round-trip examples

ASCII example

Input: Hello, 247 Tools!

Encoded output: SGVsbG8sIDI0NyBUb29scyE=

Decoding the Base64 restores the exact input.

Unicode example

Input: Café — こんにちは

Encoded output: Q2Fmw6kg4oCUIOOBk+OCk+OBq+OBoeOBrw==

UTF-8 preserves the accented letter, em dash, and Japanese text through the round trip.

UTF-8, alphabet, and padding

UTF-8 text bytes

Base64 represents bytes as text; UTF-8 is the fixed bridge between this UI's Unicode text and those bytes. This is not a charset selector and the UI does not accept arbitrary binary files.

Standard RFC 4648 alphabet

The Base64 alphabet is:

ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/

= is optional end padding, not an alphabet character or content byte.

Whitespace and optional padding

Decoding removes all whitespace before validation. Correct end padding is accepted. When padding is omitted, a cleaned length modulo four of 2 gains ==, and 3 gains =; a remainder of 0 needs none. This normalization is not Base64URL support.

Invalid input and text-only scope

Rejected Base64 forms

The decoder rejects cleaned length modulo four of 1, excessive, incorrect, or misplaced = padding, any character outside the standard alphabet and padding, and URL-safe - or _. The decoder ignores whitespace and accepts otherwise valid Base64 with omitted trailing padding, but it does not automatically repair other invalid input.

Valid UTF-8 is required

Decoded bytes that are not valid UTF-8 produce a clear error rather than replacement characters. The decoder therefore does not claim to decode arbitrary binary content.

Text-system uses and practical limits

Base64 is useful where bytes must be represented using text-safe characters, but this page handles pasted text only—no files, images, data URLs, or binary upload. There is no fixed promised input limit; very large pasted values may be slow or fail depending on the browser and device.

Base64 is encoding, not encryption

Base64 is encoding, not encryption or compression. Anyone can decode it, so it provides no secrecy or protection, and encoded output is not guaranteed to be smaller.

Private, browser-based Base64 processing

Text and Base64 input are encoded or decoded in this browser. They are not uploaded or sent to a 247 Tools server, and the tool does not save an input or output history. Copy writes only the current output to your system clipboard when you choose it. Clear removes the current input and output from the page; it does not clear the system clipboard.