URL Encoder & Decoder
Encode or decode URLs and query strings instantly — uses encodeURIComponent for safe, standards-compliant output.
What changed:
Common URL Encoded Characters
| Character | Encoded | Description |
|---|---|---|
| space | %20 | Space character |
| ! | %21 | Exclamation mark |
| " | %22 | Double quote |
| # | %23 | Hash / fragment |
| % | %25 | Percent sign |
| & | %26 | Ampersand (query separator) |
| + | %2B | Plus sign |
| / | %2F | Forward slash |
| : | %3A | Colon (protocol separator) |
| = | %3D | Equals (key=value) |
| ? | %3F | Question mark (query start) |
| @ | %40 | At sign |
What Is URL Encoding?
URL encoding, also called percent-encoding, is the process of converting characters in a URL into a format that can be safely transmitted over the internet. The HTTP protocol only allows a limited set of ASCII characters in a URL. Any character outside that set — such as spaces, ampersands, equals signs, or non-ASCII characters like accented letters — must be replaced with a percent sign followed by its two-digit hexadecimal code. For example, a space becomes %20, and an ampersand becomes %26.
This encoding is essential whenever you construct URLs programmatically — for example, when building API request URLs, embedding search queries in links, or submitting form data as query parameters. Without proper encoding, special characters can break the URL structure and cause requests to fail or behave unexpectedly.
encodeURI vs encodeURIComponent
JavaScript provides two built-in functions for URL encoding. encodeURI is designed to encode a complete URL. It leaves characters that are part of the URL structure untouched — including :, /, ?, and # — because those characters are meaningful in a URL context. encodeURIComponent, used by this tool, is stricter: it encodes all characters that are not unreserved (letters, digits, -, _, ., ~), making it ideal for encoding individual query parameter names and values.
As a rule of thumb: use encodeURI on a complete URL, and use encodeURIComponent on individual parameter values before appending them to a query string.
Common Use Cases
URL encoding appears in many everyday web development scenarios. When you append user-generated text to a query string — for instance, a search term like "hello world & more" — you must encode it so the ampersand does not break the parameter boundary. When making API calls, values passed in query parameters often contain special characters such as = or + that need to be encoded. Email links using mailto: also rely on percent-encoding for subject lines and body text. For working with structured API data, pair this tool with our JSON Formatter, and for encoding binary payloads, check out the Base64 Encoder / Decoder.
Other Free Tools
Frequently Asked Questions
Sponsored
Build and test APIs faster with Postman
Postman is the industry-standard platform for API development. Design, test, and document your APIs with URL-encoded parameters and query strings — all in one place.
Try Postman Free →