URL Encoder/Decoder
URL encode decode
URL encode decode Runs locally in your browser
About the
The URL Encoder converts text into percent-encoded form so it survives being put in a URL, and decodes it again when you are staring at something like %E4%BD%A0%E5%A5%BD and want to know what it says. Characters such as spaces, ampersands, question marks and non-ASCII letters all have special meaning inside a URL, so passing them through raw breaks the link or, worse, silently changes what the server receives. Encoding replaces each unsafe character with a percent sign followed by two hex digits.
Where people use the
- Building a search or filter URL with a value containing spaces.
- Reading a percent-encoded string copied from an address bar or a log.
- Preparing a value for an API call that requires query encoding.
- Checking why a link with an ampersand in a parameter broke.
How to use the
- 1
Choose a direction
Encode turns readable text into percent-encoded form; decode turns it back.
- 2
Paste the text
For encoding, paste the value you want to put in a query string. For decoding, paste the whole percent-encoded fragment.
- 3
Convert
The result appears immediately. If decoding fails, the input was not valid percent-encoded data.
- 4
Copy it into your URL
Encoded values go after the question mark as name=value pairs, joined with ampersands.
Tips and best practices
- Encode each parameter value separately, never the whole URL.
- If a value looks wrong on the server, check whether it was encoded twice.
- Remember the difference: %20 for URLs, plus for form bodies.
Frequently asked questions
Why did a space become %20 instead of a plus sign?
Because this uses encodeURIComponent, which follows the modern standard and produces %20. The plus sign meaning space is a form-submission convention that only applies to application/x-www-form-urlencoded bodies, not to path or query segments in general.
Why does decoding fail on my string?
Usually because a percent sign is followed by something that is not two hex digits. That happens when a string was encoded twice, or when it was cut off mid-character. Decode one layer at a time.
Does it encode an entire URL at once?
It encodes a component, not a whole URL. If you pass a complete URL through it, the slashes, colons and question marks will also be encoded, producing something the browser can no longer use. Encode individual parameter values instead.
What about UTF-8 characters such as Chinese or emoji?
They are encoded as their UTF-8 bytes, so one character becomes several percent-escaped triplets. That is correct and every server that expects UTF-8 will read it back properly.
Is the slash encoded?
Yes, encodeURIComponent encodes the slash. That is deliberate: a slash inside a parameter value must not be mistaken for a path separator.