URL encoder / decoder

Encode URLs and query parameters to percent encoding or decode them back to readable text. Instant results.

URL / text input
Encoded output
Common percent-encoded characters
Send output to:

Ctrl + L clear  |  Ctrl + Shift + C copy output

What is URL encoding and why is it needed

URLs can only contain a limited set of characters from the ASCII character set. Letters, numbers, hyphens, underscores, periods, and tildes are safe. Everything else must be percent-encoded — replaced with a percent sign followed by two hexadecimal digits representing the character's ASCII code. A space becomes %20, an ampersand becomes %26, and a forward slash in a query parameter becomes %2F. Without this encoding, URLs containing special characters would be malformed and browsers or servers might misinterpret them.

Full URL mode vs Component mode

Full URL mode — equivalent to JavaScript's encodeURI — encodes a complete URL while preserving characters that have structural meaning in URL syntax. Slashes, question marks, hash signs, ampersands, and equals signs are left unencoded because they are needed to structure the URL itself. Use this when encoding an entire URL that already has its structure in place.

Component mode — equivalent to JavaScript's encodeURIComponent — encodes everything including structural characters. A forward slash becomes %2F, a question mark becomes %3F, and so on. Use this when encoding individual URL components like query parameter values, where the structural characters in the value must be encoded so they are not confused with URL delimiters. This is the most commonly needed mode for developers building API requests and form submissions.

Common URL encoding use cases

Search query parameters containing spaces and special characters must be URL encoded before being appended to a URL. A search for "café au lait" in a query string becomes caf%C3%A9%20au%20lait. Form data submitted via GET requests is URL-encoded automatically by the browser but developers working with APIs often need to encode values manually. Authentication tokens, redirect URLs passed as parameters, and file paths with spaces all require URL encoding.

Decoding URL-encoded strings

URL decoding converts percent-encoded sequences back to their original characters. Switch to Decode mode and paste any URL-encoded string. Both %20 space encoding and + space encoding (used in HTML form data) are handled correctly. This is useful when reading encoded URLs from server logs, debugging API requests, or when you receive encoded data and need to read its original content.

Frequently asked questions

What is URL encoding?

URL encoding converts characters that are not allowed in URLs into a percent-encoded format. A space becomes %20, an ampersand becomes %26. This ensures URLs are valid and transmit correctly.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a complete URL and preserves structural characters like slashes and question marks. encodeURIComponent encodes a URL component and encodes those structural characters too. Use encodeURIComponent for individual parameter values.

Why does a space become %20 in a URL?

Spaces are not valid in URLs. %20 represents the space character using its ASCII code 32 in hexadecimal. Some query strings use + for spaces instead, which is why you see both formats.

When should I use URL encoding?

When building URLs that contain user input, special characters, or non-ASCII characters. Common cases include search parameters, API requests, form submissions, and any URL with characters outside letters, numbers, hyphens, underscores, periods, and tildes.

What characters do not need to be URL encoded?

The unreserved characters that never need encoding are letters A-Z and a-z, digits 0-9, and the four characters hyphen, underscore, period, and tilde. All others should be percent-encoded in URL components.