How to use the Base64 Encoder & Decoder
Encode or decode Base64 and Base64URL strings — the format used by JWTs, OAuth tokens, HTTP Basic auth headers, data URIs, certificates, email attachments, and API payloads. The tool handles UTF-8 text, binary files, 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 or files to standard Base64 (RFC 4648).
- Decodes Base64 back to UTF-8 text or downloads as a binary file.
- Supports Base64URL (
- and _ instead of + and /, optional padding) used by JWT and OAuth.
- Auto-detects the input variant and warns about missing or extra padding (
=).
- Handles UTF-8 correctly — emoji, accented characters, and CJK text round-trip safely.
- Encode files (images, PDFs, certificates) to Base64; decode Base64 back to a downloadable file.
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 a
data: URI from an image for inline embedding.
- Encode a small file 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
- Paste the text or Base64 string (or drop a file for binary encoding).
- Pick Encode or Decode and the variant: standard or Base64URL.
- Result appears instantly. Copy the output or download as a file when decoding to binary.
- For JWTs specifically, use the JWT Decoder for a structured view of header and claims.
- For URL-encoded text, use the URL Encoder/Decoder instead.
Tips & pitfalls
- Trim whitespace and line breaks before decoding — copy-paste often introduces them.
- 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.
- For files, prefer the file-drop area over pasting binary as text.
FAQ
- How do I encode text to Base64? Type or paste the text, click Encode, and copy the result.
- How do I decode Base64 to text? Paste the Base64 string, click Decode. The tool 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. Files are processed locally and never 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.
- Can I Base64-encode an image? Yes — drop the file; the tool produces the Base64 string ready for a
data:image/... URI.
Runs locally in your browser. No uploads. Base64 is encoding, not encryption.