How to use the URL to Base64 tool
- Paste an absolute address, including its scheme, into the URL box. Select Example to load https://example.com/?hello=world.
- Select Encode. Spaces and line breaks around the address are removed first.
- Read the Base64 string in the Result box.
- Select Copy. If the value will travel inside another URL, convert it to the URL-safe alphabet first.
How this URL to Base64 encoder works
The input goes through the browser's URL parser, the same one that backs links and fetch calls. The parser needs a scheme, so https://example.com passes while example.com and /path do not. Any scheme is fine, including mailto: and ftp:.
The parser is only a gate. What gets encoded is your trimmed text as UTF-8, not the parser's normalized form, so uppercase letters, inner spaces and non-ASCII characters stay as typed. Decoding the result returns the same string. The tool never requests the address.
A worked example
The sample address is 32 characters, which is ten full groups of three bytes plus two bytes, so the result is 44 characters with one = sign. Every Base64 string made from an address that starts with lowercase http begins with aHR0c.
Look at the slash near the end of the result. Standard Base64 can contain +, / and =, and all three have a job inside a URL. The URL-safe line shows the same bytes after the Normalize Base64 tool rewrote them as URL-safe, unpadded.
https://example.com/?hello=world
Standard: aHR0cHM6Ly9leGFtcGxlLmNvbS8/aGVsbG89d29ybGQ=
URL-safe: aHR0cHM6Ly9leGFtcGxlLmNvbS8_aGVsbG89d29ybGQBase64 is not URL encoding
URL encoding, also called percent-encoding, comes from RFC 3986. It replaces only the unsafe characters with a percent sign and two hex digits and leaves the address readable: a space becomes %20. Base64 rewrites the whole string as an opaque token that no longer looks like an address.
Use percent-encoding for ordinary query values. Reach for Base64 when one URL has to ride inside another as a single token, for example a return address in a login redirect, a state parameter, or the source address in an image proxy path.
Input rules and errors
These rules follow from the code that runs when you select Encode.
- The address must be absolute. Relative paths and scheme-relative values such as //example.com/x are rejected.
- Leading and trailing whitespace is removed before encoding.
- The error text comes from the browser's URL parser, so its wording varies by browser.
- There is no per-line mode. Several addresses on separate lines are encoded together as one value, line breaks included.
Frequently asked questions
Is Base64 the same as URL encoding?
No. URL encoding escapes individual characters with percent signs. Base64 converts the entire string into a different alphabet. A server that expects one will not understand the other, so check which one the receiving API documents.
Why does my encoded URL start with aHR0c?
The letters h, t, t, p are the bytes 68 74 74 70. Their first 30 bits always map to aHR0c, so encoded http and https addresses share that prefix. It is a handy way to spot a Base64 URL in logs.
Can I put the Base64 result in a query string?
Only after making it URL-safe. A + is read as a space by form decoders, a / splits paths, and = separates keys from values. Use the Base64URL form, or percent-encode the standard string.
Why is example.com rejected?
Without a scheme the browser cannot parse the text as an absolute URL. Add https:// or another scheme in front. To encode arbitrary text that is not a full address, use Text to Base64.
Does Base64 hide or shorten a URL?
Neither. The encoded form is a third longer than the address and anyone can decode it. If a decoded address is used for a redirect, validate it against an allow list first.