Base64URL Encode/Decode
URL-safe Base64 with padding control and gzip support
Safety note: Avoid pasting real secrets. If you need to encode credentials, do it locally. Offline option: Download the Base64URL offline tool.
Input + output
Base64URLEncode/DecodeBrowser-only
What Is Base64URL?
Base64URL is a URL-safe variant of Base64. It replaces + and / with - and _, and optionally removes = padding. Use it for JWTs, URLs, and web-safe payloads.
How to Use This Tool
- Choose Encode or Decode.
- Paste your text or Base64URL string.
- Toggle padding or gzip if needed.
- Click the action button to see the output.
Example (Base64URL Encode)
Input: hello world
Output (no padding): aGVsbG8gd29ybGQ
Gzip + Base64URL Pipeline
Enable gzip to compress text before encoding, or to decompress after decoding. This is useful for compact URLs and shareable payloads.
FAQ
Does Base64URL encrypt data?
No. It only encodes data for safe transport.
When should I remove padding?
Remove padding when an API requires URL-safe tokens without trailing =.
Is Base64URL the same as Base64?
The core encoding is the same, but Base64URL swaps characters and may remove padding.
Do This Locally (CLI)
# Encode to Base64URL (no padding)
printf '%s' "hello" | openssl base64 -A | tr '+/' '-_' | tr -d '='
# Decode from Base64URL
printf '%s' "$TOKEN" | tr '_-' '/+' | base64 -d