Encode / Decode Processed locally

Base64 Encoder & Decoder

Paste text to encode to Base64, or a Base64 string to decode. The direction auto-detects (or force it), with standard / Base64URL variants, UTF-8 and other charsets, optional line wrapping, and padding diagnostics. data: URIs work in both directions — paste one to decode its payload, or turn a local file into one without uploading it anywhere. The Analysis tab reports the decoded kind and byte count; Security sniffs decoded values for secret-looking patterns. Runs in your browser; nothing is uploaded.

Auto-runs as you type. Ctrl+Enter to re-run.

Encode a local file as a data URI
Advanced encoding options

Guide & FAQ

Encode or decode Base64 and Base64URL strings — the format used by JWTs, OAuth tokens, HTTP Basic auth headers, data URIs, certificates, and API payloads. The tool handles UTF-8 text, padding edge cases, and the URL-safe variant used by JSON Web Tokens. Everything runs in your browser; nothing is uploaded.

What it does
  • Encodes text to standard Base64 (RFC 4648).
  • Decodes Base64 back to UTF-8 text (and other charsets).
  • Supports Base64URL (- and _ instead of + and /, optional padding) used by JWT and OAuth.
  • Auto-detects the direction and variant and warns about missing or extra padding (=).
  • Handles UTF-8 correctly — emoji, accented characters, and CJK text round-trip safely.
  • Sniffs decoded values for secret-looking patterns in the Security tab.
When to use it
  • Inspect a Base64-encoded payload from an API, queue message, or log.
  • Decode the header or payload segments of a JWT (each is Base64URL).
  • Build the Base64 body of a data: URI for inline embedding.
  • Encode a small string for transport in JSON or a YAML config.
  • Decode the Authorization: Basic header to confirm a username and password (only on test credentials).
  • Convert a PEM certificate body between Base64 and raw bytes.
How to use it
  1. Paste the text or Base64 string.
  2. Leave Direction on Auto-detect (or force Encode / Decode) and pick the variant: standard or Base64URL.
  3. The result appears instantly. Copy or download the output.
  4. For JWTs specifically, use the JWT Decoder for a structured view of header and claims.
  5. For URL-encoded text, use the URL Encoder / Decoder instead.
Tips & pitfalls
  • Trim whitespace and line breaks before decoding — copy-paste often introduces them (the tool strips them for you).
  • Base64URL replaces + with - and / with _, and drops trailing = padding. JWTs and OAuth use this variant.
  • Invalid padding usually means the string was truncated or mixed between variants.
  • Base64 is not encryption — it is reversible encoding. Do not rely on it for security.
  • UTF-8 vs Latin-1 mismatches show up as mojibake — the tool defaults to UTF-8.
FAQ

FAQ

  • How do I encode text to Base64? Paste the text (Direction on Auto or Encode) and copy the result.
  • How do I decode Base64 to text? Paste the Base64 string; the tool auto-detects decode and warns about padding or character issues.
  • What is the difference between Base64 and Base64URL? Base64URL is URL-safe: + and / become - and _, and padding is optional. It is used in JWTs, OAuth tokens, and URL parameters.
  • Why does my Base64 string fail to decode? Most commonly: whitespace pasted with the string, wrong variant (URL vs standard), or truncation that broke padding.
  • Is my data uploaded? No. Encoding and decoding run in your browser. Nothing you paste is sent to a server.
  • Is Base64 a form of encryption? No — Base64 is reversible encoding designed to safely carry binary in text channels. Use real encryption for confidentiality.
  • Why do I get "invalid input" or "incorrect padding" when decoding Base64? The string is likely truncated, contains spaces or newlines, or is Base64URL (using - and _) being decoded as standard Base64. Remove whitespace, restore = padding to a multiple of 4 characters, and pick the matching variant.
  • How do I fix Base64 encoding errors? Most errors come from a wrong variant or stray characters. Switch between standard Base64 and Base64URL, strip whitespace and quotes, and ensure the length is padded to a multiple of 4.
Related guides

Runs locally in your browser. No uploads. Base64 is encoding, not encryption.