CruxDevCruxDev Tools Prompts
dev Utility • Zero-Server Privacy • 100% Client-Side

Base64 Encoder/Decoder

Encode text to Base64 or decode Base64 strings — full UTF-8 support, entirely in your browser.

Overview

Encodes and decodes UTF-8 text to and from standard Base64, live as you type — including multi-byte characters such as emoji, accents, and non-Latin scripts that break the browser's native atob() and btoa() functions when they are called directly.

How It Works

Pick Encode String or Decode Base64 with the toggle, paste into the input, and the result computes as you type. Copy places the output on the clipboard and Download saves it as a text file; both controls hide themselves when the input could not be parsed, which is the tool's error signal alongside the inline message in the output box.

Step-by-Step Usage Guide

  1. Choose Encode String or Decode Base64 with the toggle.
  2. Paste your text or Base64 string into the input area.
  3. Read the live output — on decode failures an inline error replaces it.
  4. Copy the result, or download it as a text file.

Technical Specifications & Standards

Native btoa() only accepts characters in the Latin-1 range, so a single emoji or a CJK character throws an InvalidCharacterError. This codec routes text through the TextEncoder and TextDecoder Web APIs first: encode turns the string into UTF-8 bytes and maps each byte into the ASCII-safe alphabet, and decode runs the path in reverse. The output uses the standard alphabet with padding — the URL-safe variant is deliberately out of scope here.

Targeted Use Cases

  • Producing the Base64 half of an Authorization: Basic header for an API request.
  • Decoding a Base64 string found in a config file, log line, or API response to see what it actually says.
  • Encoding short text values safely for embedding in JSON, XML, or query parameters.
  • Round-tripping a string through Base64 to confirm it survives encoding without corruption.

Notes & Gotchas

  • This tool is text-only: there is no file upload and no data-URI output, so it cannot Base64 an image or font — use a dedicated data-URI tool for those.
  • There is no URL-safe (Base64URL) mode. JWT segments and URL-bound tokens use the - and _ alphabet — decode those with the JWT decoder, which handles the variant, or swap the characters yourself first.
  • Decode does not strip whitespace or repair padding: stray line breaks or a truncated tail produce the inline error rather than a best-effort guess.
  • Base64 is an encoding, not encryption — anyone can decode it. Never treat a Base64 string as protected data.

Frequently Asked Questions

Why do emojis break other Base64 converters?

The native atob() and btoa() functions only understand Latin-1 characters. This tool routes text through UTF-8 byte encoding first, so emoji, accents, and non-Latin scripts survive the round trip.

Which alphabet does it use?

The standard RFC 4648 alphabet (A–Z, a–z, 0–9, +, /) with = padding. The URL-safe variant that swaps + and / for - and _ is not offered here.

Can I encode a file or image?

No. The tool works on pasted text only — paste a data URI's text payload if you need to inspect one, but the conversion itself is text-to-text.

Is my text uploaded anywhere?

No. Encoding and decoding run in your browser; there is no server involved at all.