URL Encoder
Encode text to URL-safe format using percent encoding. Converts special characters to %XX format for safe transmission in URLs, query parameters, and API calls.
Complete Guide: URL Encoder
Everything you need to know about using this tool effectively
The URL Encoder converts plain text into URL-safe format using percent encoding. Special characters like spaces, ampersands, and non-ASCII characters are replaced with a percent sign followed by two hexadecimal digits (e.g., space becomes %20). The tool uses encodeURIComponent() for safe encoding of URL components. All processing happens in the browser.
This tool takes your text and converts every character that is not a letter, digit, or one of - _ . ! ~ * ' ( ) into its UTF-8 byte sequence, then represents each byte as %XX. This produces a string that is safe to use in URLs, query parameters, and API calls.
Encoding query parameters
Encode user input or special characters before adding them to a URL query string.
Preparing data for API calls
Encode values that will be sent as URL parameters in REST API requests.
Creating mailto links
Encode subject lines and body text for use in mailto: links.
Debugging URL issues
Check how a string should look when properly encoded for use in a URL.
Enter your text
Type or paste the text you want to encode.
Encode
Click Encode. The tool converts special characters to percent-encoded format.
Copy the result
Copy the encoded string for use in your URL, API call, or code.
Spaces become %20 in URL encoding.
Use encodeURIComponent() for query parameter values, not encodeURI().
Always encode user input before including it in a URL.
The encoded output is longer than the input because special characters expand to 3 characters each.
What is URL encoding?
URL encoding (also called percent encoding) converts characters that are not allowed in URLs into a percent sign followed by two hexadecimal digits. For example, a space becomes %20, and an ampersand becomes %26.
When should I encode a URL?
Encode text before adding it to a URL as a query parameter, path segment, or form value. This ensures special characters do not break the URL or get misinterpreted by the server.
Is my text sent to a server?
No. All encoding happens in your browser using JavaScript's encodeURIComponent() function. Nothing is transmitted.
What is the difference between encodeURI and encodeURIComponent?
encodeURI() encodes a full URL but keeps URL structure characters like : / ? & intact. encodeURIComponent() encodes everything except A-Z, a-z, 0-9, and - _ . ! ~ * ' ( ). Use encodeURIComponent for query parameter values.
Can I decode the result?
Yes. Use a URL decoder to reverse the percent encoding and get back the original text.