This URL encoder and decoder converts text to percent-encoded format for safe inclusion in URLs, or decodes percent-encoded strings back to their original form. Spaces become %20, special characters like ampersands and question marks are properly escaped, and Unicode characters are handled through UTF-8 encoding. Everything runs in your browser, so your data never leaves your device.
Enter your values to see the result.
hello world → hello%20world
Spaces are encoded as %20 in percent-encoding.
https://example.com/path?q=hello world&lang=fr → https%3A%2F%2Fexample.com%2Fpath%3Fq%3Dhello%20world%26lang%3Dfr
The entire URL is encoded, including colons, slashes and query parameters.
caf%C3%A9 → café
Percent-encoded UTF-8 bytes are decoded back to the original accented character.
price=$19.99 → price%3D%2419.99
The equals sign and dollar sign are encoded, while digits and periods remain.
URL encoding, formally known as percent-encoding, is a mechanism for converting characters into a format that can be safely transmitted as part of a Uniform Resource Locator. The URL specification defines a limited set of characters that can appear directly in a URL. Characters outside this set must be replaced with a percent sign followed by two hexadecimal digits that represent the character's numeric value.
This encoding is essential for web development because URLs often need to contain characters that would otherwise be interpreted as URL delimiters. A question mark separates the path from the query string. An ampersand separates individual query parameters. A hash sign introduces a fragment identifier. When you need these characters to be treated as data rather than as structural elements, percent-encoding is the standard solution.
This URL encoder and decoder uses the built-in JavaScript functions encodeURIComponent and decodeURIComponent to perform the conversion. When encoding, every character that is not an unreserved character gets converted. Unreserved characters are letters, digits, hyphens, periods, underscores and tildes — these pass through unchanged. All other characters are converted to one or more percent-encoded bytes.
For non-ASCII characters, the process first converts the character to its UTF-8 byte representation. Each byte then becomes a separate percent-encoded sequence. For example, the euro sign € is three bytes in UTF-8, so it becomes %E2%82%AC. This approach ensures that any Unicode character can be safely represented in a URL, regardless of the character set or script it belongs to.
Web developers use URL encoding constantly. When building query strings dynamically, every parameter value must be encoded to prevent special characters from breaking the URL structure. A search parameter like q=hello world must become q=hello%20world or the space will cause parsing issues. Similarly, redirect URLs passed as parameters need full encoding to prevent the nested URL from being confused with the outer URL.
API developers encounter encoding when working with path parameters that contain special characters. A user profile endpoint like /users/john@example.com needs the email address encoded so the @ symbol does not interfere with URL parsing. Content management systems often generate URLs from user-provided titles, and any special characters in those titles must be properly encoded to produce valid, working links.
All encoding and decoding operations happen locally in your browser. Your input is never sent to any server, never stored in any database, and never analyzed by any third party. The JavaScript functions that perform the conversion are part of your browser's standard library and execute in microseconds, so you can encode or decode even long URLs instantly without any loading time or network dependency.
URL encoding, also known as percent-encoding, is a method of converting characters into a format that can be safely transmitted in a URL. Certain characters have special meanings in URLs — for example, the question mark starts the query string and the ampersand separates query parameters. When you need to include these characters as data rather than as delimiters, they must be encoded as a percent sign followed by two hexadecimal digits representing the character's byte value.
Characters that need encoding include spaces, which become %20, and reserved characters like exclamation marks, hash signs, dollar signs, percent signs, ampersands, single quotes, parentheses, asterisks, plus signs, commas, colons, semicolons, equals signs, question marks, forward slashes and at signs. Unreserved characters that do not need encoding include uppercase and lowercase letters, digits, hyphens, periods, underscores and tildes. Non-ASCII characters like accented letters or emojis are first converted to UTF-8 bytes and then each byte is percent-encoded.
The `encodeURI` function encodes a complete URI, leaving characters that have special meaning in URLs intact, such as colons, slashes and question marks. The `encodeURIComponent` function encodes every special character, making it suitable for encoding individual query parameter values. This tool uses `encodeURIComponent` behavior, which is the safer choice when you are encoding a value that will be placed inside a URL component rather than encoding an entire URL structure at once.
No, all encoding and decoding happens entirely in your browser using JavaScript. Your text is never transmitted over the network, never stored, and never processed by any third party. You can safely paste URLs containing sensitive parameters, tokens or personal data without any risk of the content being exposed or logged on a remote server.
Yes, this tool correctly handles Unicode characters including accented letters, CJK characters, Arabic script, emojis and any other character set. The encoding works by first converting each character to its UTF-8 byte representation and then percent-encoding each byte individually. For example, the character é becomes %C3%A9, which is the two-byte UTF-8 representation of that character.
You should decode a URL when you receive a percent-encoded string and need to read or process the original content. This commonly happens when you copy a URL from a browser address bar that has encoded parameters, when you receive encoded data from an API response, or when you need to extract query parameter values from a logged URL for debugging. Decoding converts the percent-encoded sequences back to their original characters so you can read and work with the data naturally.
Last updated on 2026-09-26 · Written by UtiliaTools