URL Encode & Decode
Convert text to URL-safe percent-encoded format or decode URL-encoded strings back to plain text. Supports both encodeURIComponent and encodeURI modes. All processing happens locally in your browser.
How to Use the URL Encoder & Decoder
- Paste your text or URL-encoded string into the input
- Click Encode to convert to percent-encoded format
- Click Decode to convert back to plain text
- Toggle between encodeURIComponent and encodeURI modes
- Copy the result with one click
What Is URL Encoding?
URL encoding, also known as percent-encoding, is a mechanism defined in RFC 3986 for representing special characters in a Uniform Resource Identifier. Characters that carry reserved meaning in URLs — such as &, =, ?, /, and # — must be encoded so they are interpreted as literal data rather than structural delimiters.
The encoding process replaces each unsafe byte with a percent sign followed by two hexadecimal digits (e.g., a space becomes %20). This ensures that any string, regardless of the characters it contains, can be safely transmitted in a URL without ambiguity or data loss.
Common Use Cases
Building API Query Strings
Encode parameter values that may contain special characters like ampersands, equals signs, or unicode text before appending them to request URLs.
Handling Special Characters in URLs
Safely include file names, user input, or multilingual text in URL paths without breaking the link structure.
Form Data Submission
HTML forms using application/x-www-form-urlencoded content type require all field values to be percent-encoded before transmission.
Deep Linking and Redirects
Encode callback URLs and redirect targets passed as query parameters so nested URLs do not conflict with the outer URL structure.
Tips & Best Practices
encodeURIComponent vs encodeURI
Use encodeURIComponent for individual query values. Use encodeURI only when encoding a full URL — it leaves reserved delimiters intact.
Avoid Double-Encoding
Encoding an already-encoded string turns %20 into %2520. Always decode first if you are unsure whether the input is already encoded.
Spaces: %20 vs +
RFC 3986 uses %20 for spaces in URLs. The plus sign (+) for spaces is specific to HTML form encoding (application/x-www-form-urlencoded).
Encode Before Concatenation
Always encode individual parameter values before joining them with & and =. Encoding the entire query string after assembly breaks delimiters.