Base64 is not URL encoding

CodeMoment · Updated 2026-10-31

Base64 and URL encoding both turn awkward bytes into text you can paste. They solve different problems, and the output of one is not the input the other expects.

Base64 takes bytes and writes them with an alphabet of 64 characters: uppercase, lowercase, digits, +, and /, plus = as padding. The text is a group of bytes first. Hello, 世界 is encoded as UTF-8 bytes, not as a list of UTF-16 code units, so the characters outside ASCII survive a round trip. URL-safe Base64 swaps + and / for - and _, because + and / are awkward inside a URL. Padding and a line wrap at 76 characters are optional when you encode. Decoding on this site accepts a missing pad and surrounding whitespace. Bytes that are not valid UTF-8 come back as hex, not as a replacement character.

That alphabet is not a disguise. Anyone can reverse Base64. Do not put a password or a token through it and call the result hidden.

URL encoding is percent-encoding. A space can become %20. In an application/x-www-form-urlencoded body, a space is often written as +, and a literal plus sign has to be escaped if you turn that reading on. Component encoding follows encodeURIComponent and escapes ?, &, =, and #, so those characters can sit inside one query value. Full URI encoding follows encodeURI and leaves them in place, so a complete URL keeps its structure. A broken % sequence is an error. This page reports it instead of skipping ahead.

A query string needs the second transform. Base64 of a phrase still contains +, /, or = in the standard alphabet, and those characters change the shape of a URL. URL-safe Base64 removes that particular clash, and it is what JWT segments use, but it is still Base64: groups of bytes, not percent-escapes. Percent-encoding a sentence does not produce the Base64 alphabet.

HTML entities are another encoding. < and < name a character in a document. They are not percent-escapes, and they are not Base64. Named mode encodes only an ampersand, a less-than, a greater-than, a double quote, and an apostrophe. Decimal and hexadecimal modes write numeric references, including letters outside ASCII. An unknown name stops. The HTML entities tool does this in the tab and does not parse a whole document.

Splitting a URL is separate from encoding one. The URL parser lists the scheme, host, path, query, and hash. A + in the query is also shown as a space. A password is reported as present and is left out of the result. The page does not open the URL.

The Base64 Encoder / Decoder and the URL Encoder both stay in the browser. Neither uploads the text. Use Base64 when the next step expects that alphabet, including a JWT segment. Use URL encoding when the next step is a query component, a full URI, or a form body.