Encode text so it can be safely used inside a URL, or decode a percent-encoded URL string back into its original readable form.
How It Works
How URL Encode / Decode Works
URLs can only reliably contain a limited set of characters. Encoding replaces anything outside that safe set — spaces, symbols like &, ?, and =, and non-ASCII characters — with a "%" followed by the character's hexadecimal byte value, so the URL remains valid and unambiguous wherever it's used.
Decoding reverses this: it finds each "%XX" sequence and converts it back to the original character, restoring readable text from the encoded URL.
Encoding is essential whenever text is inserted into a query string or path segment, since unencoded special characters (like "&" or "?") can be misread as part of the URL's structure rather than as your actual data.
Worked Example
See It In Action
Encoding "https://example.com/search?q=hello world&lang=en" produces https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3Den — every reserved character (:, /, ?, =, space, &) is replaced with its percent-encoded equivalent.
FAQ
Frequently Asked Questions
When do I actually need to URL encode something?
Whenever you're inserting user-provided or special-character text into a URL's query string — for example, a search term containing spaces or an "&" symbol — encoding it first prevents the URL from breaking or being misinterpreted.
Why does a space become "%20" instead of a plus sign?
This tool uses standard percent-encoding (encodeURIComponent), which converts spaces to %20. Some older systems use "+" for spaces specifically within form data (application/x-www-form-urlencoded), which is a related but slightly different convention.
Is encoded text the same length as the original?
No — each encoded special character expands from 1 character to 3 (a "%" plus two hex digits), so heavily-encoded text is noticeably longer than the original plain text.