URL encoding and Base64 solve different problems: three reproducible checks
Disclosure: this is an ALink team post. The two linked browser tools are ours. This guide was prepared with AI assistance; the examples below were checked in the live tools on November 28, 2026. A string can be valid Ba
Disclosure: this is an ALink team post. The two linked browser tools are ours. This guide was prepared with AI assistance; the examples below were checked in the live tools on November 28, 2026.
A string can be valid Base64 and still be awkward to put directly into a query parameter. Percent encoding and Base64 answer different questions. A tiny input makes the distinction easier to see.
1. Encode a value for a URL component
Start with this literal text:
a+b/c?
In the ALink URL Encoder / Decoder, select Encode, keep Component (encodeURIComponent) mode, and paste that text. The result is:
a%2Bb%2Fc%3F
The plus, slash and question mark have each become percent escapes. This is useful when the original text is a value inside a larger URL. It does not mean the entire URL should be treated as one component: encoding an entire URL this way also encodes its structural separators.
For an actual query string, let the browser build it:
const params = new URLSearchParams({ value: 'a+b/c?' });
console.log(params.get('value')); // a+b/c?
Avoid concatenating raw user input after ?value=. A literal plus can be confused with a space by form-style query parsers.
2. Base64 represents bytes with a text alphabet
Paste the same text into the ALink Base64 Encoder & Decoder and select Encode, with URL-safe mode unchecked:
YStiL2M/
This output still contains a slash. Standard Base64 is not a substitute for escaping a query parameter. Either pass it through URLSearchParams, or use a Base64url format if that is what the receiving protocol specifies. Do not silently change alphabets or padding when an API expects a particular format.
Base64 is reversible encoding, not encryption. Encoding a token does not make it safe to publish in a screenshot, log or support ticket.
3. Make the character encoding explicit
The input δ½ ε₯½ produced 5L2g5aW9 in the Base64 tool. That is the Base64 representation of its UTF-8 bytes. For a small browser-console example:
const bytes = new TextEncoder().encode('δ½ ε₯½');
const encoded = btoa(String.fromCharCode(...bytes));
console.log(encoded); // 5L2g5aW9
This short example is for small strings; spreading a large byte array can exceed argument limits. Calling btoa directly on arbitrary Unicode text is a different operation and can throw for characters outside its byte-string range.
Before debugging a decoder, check four things: the expected alphabet, padding rules, UTF-8 versus another character encoding, and whether the value has been percent-decoded exactly once. Those details matter more than how readable the encoded string looks.
These checks cover the two short text examples above. They are not a benchmark of large files, a security audit, or a promise about every browser. Both tool pages include their controls and limitations so you can reproduce the same inputs yourself.
Originally published by Dev.to WebDev. Aggregated on AIWithGhost for educational purposes β full credit and traffic to the original publisher.