Skip to main content
NeatUtility

Base64 Encoder & Decoder

Encoders & Decoders100% Client-Side
Ready
TEXT
0 lines0 chars
0 B / 4.77 MB
About this tool, examples & FAQ

Encode UTF-8 text to standard or URL-safe Base64 and decode Base64 back to text, entirely in your browser. Decoding is strict: invalid characters and non-UTF-8 bytes are rejected, and decoding never requires a secret.

Key facts

Verified capabilities and limits of this utility
Accepted inputUTF-8 text for encoding, Base64 text for decoding; text only, no file or binary output
Alphabets and paddingStandard alphabet or URL-safe variant, with trailing padding kept or omitted
Max input size5 MB
Execution deadline2 s
Processing locationBrowser-only: pasted input is not uploaded

How to use

  1. Type or paste your raw text or Base64 string into the input editor.
  2. Select the operation: 'Encode' or 'Decode'.
  3. Toggle 'URL Safe' to swap '+' and '/' with '-' and '_' for links or tokens.
  4. Toggle 'Include Padding' to keep or omit '=' padding characters.
  5. Click 'Run' to compute the result.
  6. Use 'Swap' to reverse the operation and cycle between encoding and decoding.

Examples

Encode Hello

Input

Hello

Example output

SGVsbG8=

Encode Unicode text

Input

नमस्ते 🌍

Example output

4KSo4KSu4KS44KWN4KSk4KWHIPCfjI0=

Edge cases

Empty input

Empty input succeeds with an empty output; whitespace-only input to decode also decodes to an empty string.

Lone surrogates

Lone surrogate characters cannot be encoded to UTF-8 and are rejected instead of being silently replaced.

Invalid Base64 on decode

Characters outside the Base64 alphabet and lengths with remainder 1 modulo 4 are rejected with an invalid-input error.

Non-UTF-8 bytes on decode

Decoded bytes must be valid UTF-8: arbitrary binary payloads that are not UTF-8 text are rejected because the tool decodes to text only.

URL-safe and padding tolerance

Decoding auto-normalizes the URL-safe alphabet and restores missing padding, so unpadded Base64URL values still decode.

How it works

  1. Encodes text to UTF-8 bytes, then to Base64 in chunks.
  2. Applies the URL-safe alphabet substitution and padding option for encoding.
  3. For decoding, strips whitespace, normalizes URL-safe characters, and restores missing padding.
  4. Validates the alphabet and length before decoding bytes to strict UTF-8 text.
  5. Executes inside a Web Worker bounded by the tool deadline.

Frequently asked questions

Is Base64 encryption?

No. Base64 is a reversible text encoding with no secret: anyone can decode it. It hides nothing and must not be used to protect sensitive data.

What does the '=' padding mean?

Padding aligns the output to 4-character groups. The Include Padding toggle keeps or omits trailing '=' characters; decoding restores missing padding automatically.

What is Base64URL?

Base64URL swaps '+' and '/' for '-' and '_' so encoded values survive in URLs and filenames without extra escaping. The decoder accepts both alphabets.

Why is Base64 output larger than the input?

Base64 represents every 3 input bytes as 4 characters, so output grows by roughly a third plus any padding — that overhead is inherent to the encoding.

Does this handle Unicode and emoji?

Yes, text is encoded as UTF-8 bytes, so international scripts and emoji round-trip. Lone surrogate characters are the exception: they cannot form UTF-8 and are rejected.

Why does some Base64 fail to decode here?

Decoding succeeds only for valid-alphabet input that also yields valid UTF-8 text. Random or binary Base64 that is not UTF-8 text is rejected because this tool decodes to text, not to files or binary.

References