Toolinho Back to Home
🔗

URL Encoder / Decoder

Encode and decode special characters in URLs

About URL Encoder Decoder

URL encoding — also called percent-encoding — replaces characters that would otherwise break a web address with a % followed by their hexadecimal byte value. It is what lets a query string safely carry spaces, ampersands, slashes and non-English characters.

Which characters need encoding

Some characters carry structural meaning in a URL: ? starts the query, & separates parameters, = joins a key to its value, / divides path segments and # begins a fragment. When any of these appears inside a value rather than as structure, it must be encoded, or the receiving server will read it as punctuation. Spaces and characters outside ASCII are always encoded.

Worked example: the value a b&c=1 becomes a%20b%26c%3D1 — space to %20, ampersand to %26, equals to %3D — so the server reads it as one value rather than three parameters.

Should I encode the whole URL or just one parameter?

Just the parameter, almost always. Encoding a complete address escapes the separators you need and produces something unusable. In JavaScript this is the difference between encodeURI, which preserves structure, and encodeURIComponent, which escapes everything — use the latter on each value you insert.

Why do I sometimes see + instead of %20?

Both can mean a space, in different contexts. HTML form submissions historically encode spaces as + in the application/x-www-form-urlencoded format, while percent-encoding in a path uses %20. Decoders must know which convention applies — a literal plus sign in form data is therefore encoded as %2B.

Try our other free tools: base64 encoder, hash generator, and JSON formatter.