URL Encoder & Decoder
Encode and decode URLs and query strings online using percent-encoding. Handles special characters, spaces, Unicode, and full URL component parsing — no signup required.
Common URL Encoded Characters
About the URL Encoder & Decoder
The DevToolHeaven URL Encoder and Decoder converts text between its human-readable form and percent-encoded URL format. URL encoding — also called percent encoding — is essential when including special characters in URLs, API query strings, and web form submissions.
When building API requests, query string values often contain characters that break URL parsing: spaces, ampersands, equals signs, and non-ASCII characters. Without encoding, a value like "name=John & age>30" would be misread as multiple parameters. URL encoding converts each unsafe character to %XX, where XX is the UTF-8 hexadecimal representation of that byte.
Choose Component mode (encodeURIComponent) when encoding individual values to embed inside a URL — it encodes everything except letters, digits, and the characters - _ . ~. Use Full URL mode (encodeURI) when encoding a complete URL while leaving its structural characters (://, ?, &, =, #, /) intact.
URL decoding reverses the process, converting %XX sequences back to their original characters. This is useful when reading encoded URLs from server logs, debugging webhook payloads, inspecting redirects that carry encoded parameters, or unwrapping values that were double-encoded by a framework.
The reference table shows the most frequently encountered percent-encoded characters for quick lookup. Note that a space can appear as either %20 (the standard) or + (the older HTML form encoding convention used in query strings).
All processing is 100% client-side — your data never leaves your browser. The tool handles both ASCII and Unicode input, automatically converting non-ASCII characters to their UTF-8 byte sequences before percent-encoding.
Frequently Asked Questions
URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a format that can be transmitted safely. Each unsafe character is replaced with a percent sign followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20.
You need URL encoding when including special characters in a URL — in query string parameters, path segments, or form data. Characters like spaces, &, =, #, and non-ASCII characters must be encoded to avoid breaking the URL structure or being misinterpreted by the server.
Component mode (encodeURIComponent) encodes everything except letters, digits, and - _ . ~ characters. Use this for individual query string values. Full URL mode (encodeURI) preserves URL structural characters like :// ? & = # / and only encodes truly unsafe characters. Use this for complete URLs.
In ASCII encoding, a space character has the decimal value 32, which is 20 in hexadecimal. URL encoding uses hexadecimal, so a space becomes %20. You may also see + used for spaces in query strings — this is an older convention from HTML form encoding.
Yes. Non-ASCII characters like Arabic, Chinese, or accented letters are first converted to UTF-8 bytes, then each byte is percent-encoded. For example, the Arabic letter ا becomes %D8%A7 because its UTF-8 encoding is the bytes D8 and A7.
URL encoding makes text safe for use in URLs by replacing special characters with % sequences. Base64 converts binary data to a text-safe format using 64 printable characters. They solve different problems — use URL encoding for query parameters and Base64 for embedding binary data in text formats.
encodeURI() encodes a complete URL — it preserves characters that have structural meaning in URLs like /, ?, &, =, #, and :. encodeURIComponent() encodes a single URL component (like a query parameter value) — it encodes those structural characters too. Always use encodeURIComponent() for individual query string values to prevent them from breaking the URL structure.
A space is encoded as %20 using standard percent-encoding (encodeURIComponent). In the query string portion of a URL, spaces are sometimes encoded as + — this comes from the older application/x-www-form-urlencoded format used by HTML forms. Both %20 and + represent spaces, but %20 is the correct form in path segments.
Use curl with --data-urlencode for automatic encoding: curl -G "https://api.example.com/search" --data-urlencode "q=hello world". For manual encoding in a script, use Python: python3 -c "import urllib.parse; print(urllib.parse.quote('hello world'))". Alternatively, paste your string here and copy the encoded output.
Unreserved characters are always safe without encoding: letters (A-Z, a-z), digits (0-9), and the symbols - _ . ~. All other characters — including spaces, &, =, ?, #, /, :, @, and non-ASCII characters — must be percent-encoded when used in query parameters or path segments.
%2F is a percent-encoded forward slash. A literal / in a URL path means a path separator. If you need to include a literal slash as part of a path parameter or query value — such as a date "2024/01/15" or a file path — it must be encoded as %2F so the server does not treat it as a path segment separator.
Use decodeURIComponent() for individual components: decodeURIComponent("hello%20world") returns "hello world". Use decodeURI() for a complete URL. The URL class also parses and decodes URLs automatically: new URL("https://example.com/search?q=hello%20world").searchParams.get("q") returns "hello world".