URL Encoder and Decoder
Encode a URL component or decode percent escapes in query values and form data.
Runs in your browser. Your input stays on this device.
What this tool does
Apply or remove percent escapes for a URL component or a form field.
When to use it
Encoding a query value keeps an embedded ampersand and plus sign from being interpreted as query syntax or a space.
How to use it
- Paste one value, without the surrounding parameter name or equals sign.
- Select Encode or Decode and choose URL component or Form field.
- Run Convert URL text and place the result in the intended component.
Worked example
Enter café & tea + ice in URL component mode and encode it. The ampersand becomes %26 and the literal plus becomes %2B, so both stay inside a single query value. Add the result after ?q= in a URL. Keep the parameter name and equals sign outside the input. In Form field mode, a space becomes a plus sign, while a literal plus still becomes %2B. Decode the result using the matching mode and compare it with the original before using it in a test case.
tea & ice+limetea%20%26%20ice%2BlimeSupported features and limitations
In URL component mode a literal plus remains a plus during decoding. Encode a complete URL only when it is itself a query value, such as a redirect target.
Common mistakes and edge cases
Encoding a whole URL also escapes delimiters such as the colon and slashes. Use component mode for the individual value you are inserting. A full URL is a suitable input when it is itself the value of a parameter, such as a redirect destination. Re-encoding %26 produces %2526, so check whether your URL builder already encodes values. A bare percent sign or an incomplete escape can trigger a decoding error. When debugging a callback parameter, decode one layer before inspecting the nested URL. Decode its query values independently as needed. Repeatedly decoding the entire string can turn encoded delimiters into characters with a different meaning.
Frequently asked questions
- Why does a plus sometimes decode to a space?
- Form encoding treats plus as a space. Component decoding preserves a literal plus. Choose the mode based on the format the sender used so values such as C++ survive the conversion.
- Should I encode before calling URLSearchParams?
- Pass the original string into URLSearchParams when using its setter methods. They take care of the query serialization. Manually encode a value when composing an individual component yourself, or when inspecting how an existing URL represents a value.