URL Encode/Decode

Make text safe for a URL, or decode it back to plain text.

Encoded output
hello%20world%3Ffoo%3Dbar%26baz%3D1

URL encoding replaces characters that aren't safe in a URL (spaces, &, ?, and others) with a % followed by their hex code — necessary whenever those characters need to appear inside a query string or path.

A worked example

The text hello world?foo=bar encodes to hello%20world%3Ffoo%3Dbar — each unsafe character replaced with its percent-encoded form.

Frequently asked questions

Why do spaces become %20 in a URL?

URLs can't contain literal spaces — %20 is the percent-encoded (hex) representation of the space character, one of several reserved or unsafe characters that need to be escaped this way to appear in a URL.

When do I actually need to URL-encode something?

Whenever you're building a URL programmatically and inserting user input or special characters into a query string or path segment — without encoding, characters like &, ?, #, or spaces can break the URL's structure or be misinterpreted.