100% Free No Sign-Up Unlimited Use No Limits Secure & Private
PDF Tools Calculators Categories Guides Contact No Sign-Up Needed to Use This Site
Result
--
Enter values to calculate.
Summary
--
Waiting for input
Detail
--
Waiting for input

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.
Real-World Use Cases

Who Uses URL Encode / Decode and Why

  • Building a link that passes user-entered text (like a search query) as a URL parameter without breaking the link if it contains spaces or special characters.
  • Decoding a long, percent-encoded URL copied from an address bar or API response to read what it actually says.
  • Preparing a value containing an ampersand or question mark to be safely embedded inside a query string without being misread as part of the URL's structure.
  • Troubleshooting a broken link where special characters in a parameter are interfering with how the URL is parsed.
Common Mistakes

Mistakes to Avoid

  • Encoding an entire URL (including https:// and the domain) when only a specific parameter value needs encoding — this breaks the URL's actual structure instead of protecting it.
  • Double-encoding a value that's already been percent-encoded, which turns a valid %20 into %2520 and produces the wrong result when decoded downstream.
  • Assuming a plus sign and %20 are always interchangeable — %20 is standard percent-encoding for a space anywhere in a URL, while a plus sign specifically means a space only within query strings and form submissions, not in every part of a URL.
Pro Tips

Tips for Best Results

  • Only encode the specific value going into a parameter, not the surrounding URL structure — encode the piece of user input, then assemble it into the full URL afterward.
  • If a URL looks broken because of unencoded special characters, decode it first to see the intended content clearly, then re-encode just the parts that need it.
Troubleshooting

Fixing Common Problems

The decoded text still has percent signs and codes in it. — The text may have been encoded twice — try running it through the decoder a second time, or check whether the source that generated it double-encoded the value by mistake.

A link works in some places but breaks when pasted elsewhere. — Unencoded special characters (spaces, ampersands, question marks) in the URL can be interpreted differently by different systems — encode the affected parameter values before sharing the link.

Glossary

Terms Explained

Percent-encoding: The scheme of replacing a special character with a percent sign followed by its hexadecimal code, used to safely represent characters that would otherwise break a URL's structure.

Query string: The part of a URL after the ? that holds key-value parameters, where a plus sign is conventionally used to represent a space.

Reserved characters: Characters like /, ?, #, and & that have a specific structural meaning within a URL and must be encoded when used as literal data rather than structure.

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.