URL to Base64 — Online URL Encoder
🔒 Runs in your browser — nothing is sent to a serverURL to Base64 encoding converts a link — full URL, signed redirect target, OAuth callback, referrer header, or tracking pixel — into a compact ASCII string that can travel through JSON APIs, JWT claims, email templates, and QR payloads without being broken by the `?`, `&`, `#` or `/` characters. The output is classic Base64; swap `+/` for `-_` and strip `=` padding when you need URL-safe Base64 (base64url). Everything runs 100% in your browser; your links never leave the device, nothing is uploaded or logged.
When to Base64-encode a URL
Base64-encoding a URL is the right call whenever a link must travel inside another structured payload. Typical moments: embedding a callback URL in an OAuth `state` parameter so CSRF checks survive the provider round trip; packing a long redirect destination into a short-link service's payload without hitting path-length limits; storing a tracking URL inside a JSON column where `&` and `?` would be ambiguous; placing a deep link inside a JWT claim so the token stays self-contained; or carrying a signed download URL through a chat API that strips query strings. The encoded form is opaque to middleware and safe to transport.
How URL-to-Base64 encoding works
URL-to-Base64 encoding treats the URL as UTF-8 text and applies the standard Base64 algorithm. First the URL string is converted to its UTF-8 byte sequence — for plain ASCII links this is identity, for internationalised domain names it expands to 2–4 bytes per non-Latin character. Second, every three bytes are split into four 6-bit values, each mapped to a character in the 64-symbol alphabet (A–Z, a–z, 0–9, +, /). Trailing `=` padding fills the final group when necessary. Decoding reverses the process and reassembles the original URL exactly. The encoder makes no semantic changes — `?` stays `?` inside the encoded bytes.
Examples
https://example.comaHR0cHM6Ly9leGFtcGxlLmNvbQ==https://example.com/search?q=base64&lang=enaHR0cHM6Ly9leGFtcGxlLmNvbS9zZWFyY2g/cT1iYXNlNjQmbGFuZz1lbg==