Percent-encode text for URLs or decode an encoded URL.
Processed locally in your browser.
How do you URL-encode text?
Encoding replaces unsafe characters with a "%" followed by their hex byte values (encodeURIComponent), and decoding reverses the process. Use it for query-string values and parameters so special characters do not break the link. For example, "a b&c" encodes to "a%20b%26c", keeping the URL valid and readable.
Understanding your result
Use this for query-string values and parameters so special characters do not break the link.
Formula and method
Encoding replaces unsafe characters with a “%” followed by their hex byte values (encodeURIComponent); decoding reverses the process.
Assumptions and limitations
This tool encodes a value the way encodeURIComponent does, treating the whole input as a single component. It does not know your URL's structure, so it will percent-encode characters like slashes and question marks that you may intend to keep literal when encoding a full address.
Worked example
“a b&c” encodes to “a%20b%26c”.
How to use this tool
- Pick Encode to percent-encode text, or Decode to expand an encoded URL.
- Paste the URL or text.
- Copy the encoded or decoded output.
Common mistakes to avoid
- Decoding a string that contains an invalid percent sequence.
About the URL Encoder / Decoder
Make text safe to include in a URL by percent-encoding special characters, or decode an encoded URL back to normal text.
Who should use this tool
Web developers assembling query strings, API consumers passing values as parameters, and anyone constructing links where text contains spaces, ampersands, or other reserved characters. Also useful for decoding an encoded URL copied from a browser address bar or a server log back into readable form.
Benefits
- Makes query values safe by escaping reserved characters
- Decodes percent-encoded URLs back to readable text
- Prevents special characters from breaking a link
- Encodes and decodes locally with nothing sent away
Practical use cases
- Encoding a search term for a query-string parameter
- Escaping an ampersand so it survives inside a URL
- Decoding a redirect URL captured from a log
- Preparing a value before appending it to an API endpoint
Explore all Developer Tools tools
Frequently asked questions
Component or full URL?
This encodes for component values (the safest default), so reserved characters like & and ? are escaped.
Why does a space become %20 instead of a plus sign?
This tool follows encodeURIComponent, which encodes a space as %20. The plus sign is used only in the application/x-www-form-urlencoded format for form submissions. For values placed into a URL path or query, %20 is the correct and universally safe representation of a space.
Should I encode the whole URL or just each value?
Encode only the individual values you insert, such as query-string parameters, not the entire URL. Encoding the whole address would escape the slashes, colon, and question mark that give the URL its structure, breaking it. Percent-encode each dynamic piece separately, then assemble the link.