Base64 Encode & Decode - Encode & Decode Base64 Online

Convert plain UTF-8 strings into Base64 payloads or decode Base64 strings back to readable text locally in your browser. Includes URL-safe Base64 mode (- and _), validation errors, and one-click copying.

Base64 Encode & Decode

How to use this tool

  1. 1Choose Encode to Base64 or Decode Base64 using the two mode buttons at the top left.
  2. 2When encoding, check URL-safe (- and _, no padding) if you need hyphen and underscore characters without trailing equals signs for URLs or tokens.
  3. 3Paste your plain text or Base64 string into the left input box to compute the converted output live on the right.
  4. 4Click Copy to save the converted result, Swap Input & Output to flip direction and test round-tripping, or Clear to reset.

What this tool does

The converter encodes and decodes data strictly inside your browser tab without transmitting strings to any external server:

  • Encodes strings into UTF-8 bytes via TextEncoder before applying standard Base64 transformation, ensuring accented letters, Unicode symbols, and emojis survive intact without garbling characters.
  • Supports URL-safe Base64 output by replacing "+" with "-", replacing "/" with "_", and trimming trailing "=" padding.
  • Decodes both standard and URL-safe Base64 inputs by stripping whitespace, restoring missing "=" padding, and decoding bytes with fatal UTF-8 validation.
  • Displays a clear error banner whenever an input string has invalid Base64 length, disallowed characters, or broken UTF-8 byte sequences.
  • Provides Clear, Swap Input & Output, and Copy controls so you can verify round-trip decoding immediately inside browser memory.

Example

Sample text (Encode to Base64, standard mode)
hello@example.com
Base64 output
aGVsbG9AZXhhbXBsZS5jb20=

Enabling URL-safe (- and _, no padding) omits the trailing "=" character and substitutes "-" and "_" whenever "+" or "/" appear. Everything computes locally inside your tab with zero server requests.

Frequently asked questions

What is Base64 used for?

Base64 represents arbitrary binary bytes using 64 printable ASCII characters. Developers use it to safely embed images in data URLs, carry payloads inside JSON or HTTP headers, and pass compact binary segments in URLs.

Is Base64 a form of encryption?

No. Base64 is a reversible encoding format with no secret key. Anyone can decode a Base64 string back to its original bytes instantly, so it must never be used alone to hide passwords or confidential secrets.

What is URL-safe Base64?

Standard Base64 uses plus (+), slash (/), and equals (=) padding, which carry special meanings in URLs. URL-safe Base64 substitutes hyphen (-) for plus, underscore (_) for slash, and omits trailing equals signs.

Does this Base64 tool handle emojis and non-English letters?

Yes. The encoder converts your text to UTF-8 bytes with TextEncoder before Base64 conversion and decodes bytes back with fatal UTF-8 validation.

Related tools

View All Tools