URL Encoding Guide: Encode Query Parameters
What URL encoding means
URLs have reserved characters that can change their structure. A space, ampersand, question mark, or non-ASCII character may need percent-encoding before it is placed in a URL. Encoding represents the character as % followed by hexadecimal digits.
Use the free URL Encoder and Decoder to encode text or decode percent-encoded values directly in your browser.
Encode a complete URL or a single value
The correct operation depends on what you are encoding:
- Full URI mode uses JavaScript's
encodeURI()behavior. It keeps URL structure such as:,/,?, and&meaningful. - Component mode uses
encodeURIComponent()behavior. It treats the input as one value, which is usually correct for a query-string parameter or a path segment.
For example, a search value such as red shoes & socks should be encoded as one component before it is inserted into a query string. Encoding the entire URL as a component would also encode the separators and change its structure.
How to use an online URL encoder
- Open the online URL encoder.
- Choose Encode URL.
- Use Component for a single parameter or Full URI for an already structured URL.
- Paste the input, then copy or download the result.
The decoder works in the reverse direction. If the input contains an invalid percent escape, the tool reports an error instead of silently returning a misleading result.
Encoding is not validation or security
Percent-encoding does not make a URL safe for every context. It does not sanitize HTML, prevent SQL injection, verify that a destination is trustworthy, or encrypt a password. Encode values at the boundary where they are inserted into the URL, then validate and handle the URL in the application that consumes it.
Also remember that encoding the same text more than once can produce a different value. Decode only when you know which layer produced the value, and avoid manually replacing characters when the platform's URL APIs are available.
Related tools and guides
- Regex Tester — inspect or validate URL patterns.
- Base64 Converter — compare URL encoding with Base64 representation.
- What is JSON? — understand another common data format used in API URLs and responses.