🔢

Base64 URL Encode / Decode — URL-Safe Base64 Online

Text · Image · File — URL-safe mode · auto-detect · live image preview — 100% browser-side

PLAIN TEXT INPUT
BASE64 OUTPUT
🔢

Paste text → get Base64

Real-time · No button click · 200ms debounce

Ctrl+L ClearCtrl+S DownloadCtrl+Shift+C Copy outputCtrl+Enter Re-processP Pin
💡

Base64URL (URL-safe Base64) replaces + with - and / with _ and removes = padding — making it safe for URLs, JWT tokens, OAuth tokens, and filenames. Enable the URL-safe toggle to switch between standard Base64 and Base64URL automatically. Auto-detect identifies which format your input is and suggests the correct mode.

📌 URL-safe mode
Standard: "SGVsbG8+V29ybGQ/"
URL-safe: "SGVsbG8-V29ybGQ_"

What is Base64 Encoding?

Base64 encoding converts binary data into a string of 64 safe ASCII characters — A–Z, a–z, 0–9, +, and /. It is the standard way to embed binary content (images, files, certificates) inside JSON, XML, HTML, and email without breaking the format. The encoded output is ~33% larger than the original.

Standard vs URL-Safe Base64

Standard Base64 uses + and / which have special meaning in URLs. URL-safe Base64 (Base64URL) replaces +- and /_ and removes = padding. Use URL-safe mode for JWT tokens, OAuth tokens, and URL query parameters.

Frequently Asked Questions

What is Base64URL and how is it different from Base64?

Base64URL is a variant of Base64 designed for URLs and filenames. It replaces + with -, / with _, and removes = padding. This avoids URL encoding issues since +, /, and = have special meanings in URLs. JWT tokens use Base64URL for their header and payload.

How do I decode the payload of a JWT token?

A JWT looks like xxxxx.yyyyy.zzzzz. The payload is the second part (yyyyy). Enable URL-safe mode, paste the payload section, and set Direction to Decode. The tool decodes the Base64URL and shows the JSON claims (sub, iat, exp, etc.).

When should I use URL-safe Base64?

Use Base64URL for: JWT tokens, OAuth access/refresh tokens, PKCE code challenges, URL query parameters, cookie values, filename-safe identifiers, and any Base64 that will appear in a URL without percent-encoding.

Can I convert between standard Base64 and Base64URL?

Yes — encode your text with standard Base64, then enable URL-safe toggle to get the Base64URL version. To go back, enable URL-safe and decode: the tool adds padding and replaces - → + and _ → / automatically.

How does auto-detect work for Base64 vs Base64URL?

When you paste input, the tool checks for + and / characters (standard Base64) vs - and _ (Base64URL). If it detects Base64URL, it shows a detection banner and auto-applies the correct decoding. You can override by toggling the URL-safe switch manually.