URL encoder and decoder
Encode or decode one URL component with JavaScript percent-encoding rules.
Inputs stay in your browser
Interactive tool
Enable JavaScript to use the interactive controls. The guide below is available without JavaScript.
The URL encoder and decoder apply percent-encoding to text intended as a URL component, or decode valid percent-encoded sequences. It processes the entire input as one component rather than parsing a complete URL into scheme, host, path, and query fields.
When to use this tool
- Encode a query parameter value containing spaces or non-ASCII text.
- Decode a percent-encoded path or parameter value for inspection.
How to use
- Enter plain component text for Encode or encoded text for Decode.
- Choose the direction.
- Review and copy the result; malformed escape sequences produce an error.
Example
Encode component text
The input a b/世界 becomes a%20b%2F%E4%B8%96%E7%95%8C because the slash is encoded as part of the component.
How it works
- Encoding uses JavaScript encodeURIComponent and decoding uses decodeURIComponent, including UTF-8 percent sequences.
Limits and notes
- This tool does not parse or validate a complete URL and will encode reserved separators such as /, ?, &, and = when they appear in the input.
- A plus sign is not converted to a space; HTML form encoding has different rules.
- Malformed percent escapes are rejected.
Frequently asked questions
Why was the slash encoded?
encodeURIComponent treats the input as one component, so a slash is data rather than a path separator.
Does decoding validate the whole URL?
No. It only decodes percent escapes in the supplied text.
References
Related tools
Send tool feedback
The message includes page context only, never tool input or results.
Send tool feedback