BuildUtilities

What is URL encoding?

Replacing unsafe characters in a URL with a % followed by their hex byte, so spaces, & and ? don't break the URL.

Some characters can't appear literally in a URL, `?` starts the query string, `&` separates params, spaces aren't allowed at all. URL encoding replaces them with `%` + their two-digit hex byte: space becomes `%20`, `&` becomes `%26`.

Browsers and HTTP libraries handle most of it automatically, but you'll need to encode manually when building URLs from user input or putting JSON into a query parameter.

Don't confuse it with HTML entity encoding (`&`), different alphabets, different rules.

Encoded space

hello%20world

Related tools

Keep reading

Tip Jar