URL encoder / decoder

Encode and decode URLs for use in query strings and parameters

Enter a value or URL — spaces, &, =, and other reserved characters will be percent-encoded.

This tool runs entirely in your browser. Your text is never uploaded or sent to a server.

About this tool

URLs can only contain a limited set of ASCII characters. Characters outside this set — including spaces, punctuation, non-ASCII letters, and reserved characters like `&`, `=`, and `#` — must be percent-encoded: replaced by a `%` followed by their two-digit hexadecimal code. This tool encodes strings for safe inclusion in URLs and decodes percent-encoded strings back to their original form. It's useful when constructing query strings, parsing URL parameters, or debugging URL-related issues.

Common uses

  • › Encoding values to include safely in query string parameters
  • › Decoding percent-encoded URLs from server logs or API responses
  • › Preparing strings for use in redirect URLs
  • › Debugging URL encoding issues in web applications
  • › Encoding special characters in REST API request parameters

Example

Input
hello world & goodbye?
Output
hello%20world%20%26%20goodbye%3F

Technical notes

  • › This tool uses encodeURIComponent/decodeURIComponent, which encode all reserved characters — suitable for individual query parameter values, not for a full URL that already contains structural characters like :// and /.
  • › Space characters are encoded as %20 by this tool, following URI percent-encoding rules; some older form-encoding contexts instead use + for spaces, which is a different (though related) convention.
  • › Encoding a value twice ("double encoding") produces incorrect results — % itself gets encoded to %25 on a second pass, which is a common source of bugs when values pass through multiple systems.

FAQ

Why is my space character showing as %20?

%20 is the percent-encoded representation of a space in a URL. Some contexts (like HTML form submissions) use + instead, but %20 is the more general and universally correct encoding.

Should I encode an entire URL or just parts of it?

Encode individual query parameter values, not the whole URL — encoding the full URL would also escape essential structural characters like :, /, ?, &, and = that need to stay intact.

Why did decoding my string produce garbled text?

This usually means the string was already decoded, or was encoded with a different character encoding — percent-decoding text that isn't actually percent-encoded will produce unexpected results.

Related tools