URL Encoder / Decoder

Encode and decode URLs and query parameters

About this tool

The URL Encoder converts special characters in URLs and query strings to their percent-encoded equivalents (%20 for space, %3D for =, etc.) and back. Percent-encoding is required by RFC 3986 to ensure URLs remain valid when they contain characters outside the ASCII safe set.

When to use it

  • โ†’Encoding query parameter values before appending them to a URL
  • โ†’Decoding URLs copied from browser DevTools, logs, or curl output
  • โ†’Building API request strings that contain special characters
  • โ†’Decoding what a suspicious or complex-looking URL actually contains

Tips

  • โ—†Encode only the query parameter values โ€” not the entire URL. Encoding slashes and colons in the domain will break the URL.
  • โ—†Spaces encode to %20 in standard percent-encoding and to + in application/x-www-form-urlencoded (HTML form data).
  • โ—†Most modern browsers auto-encode URLs when you paste them, but HTTP clients like curl do not.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent in JavaScript?

encodeURI encodes a full URL โ€” it leaves characters like /, ?, #, and & untouched because they are structural. encodeURIComponent encodes a query parameter value โ€” it encodes everything except letters, digits, and - _ . ~ . Use encodeURIComponent for individual values, encodeURI for full URLs.

Why does my URL break when I include an ampersand or equals sign in a query value?

Ampersands (&) separate query parameters, and equals signs (=) separate keys from values. If those characters appear inside a parameter value, they must be percent-encoded (%26 and %3D respectively) so the server doesn't misinterpret them as parameter delimiters.

When should I use + instead of %20 for spaces?

The + sign represents a space only in the application/x-www-form-urlencoded format used by HTML forms. In standard URL percent-encoding (RFC 3986), spaces must be encoded as %20. Most modern APIs accept either, but %20 is more universally correct.

Which characters are safe in a URL without encoding?

Unreserved characters that never need encoding: A-Z, a-z, 0-9, hyphen (-), underscore (_), period (.), tilde (~). Everything else โ€” including spaces, brackets, quotes, and non-ASCII characters โ€” must be percent-encoded in query parameter values.

Related tools

๐Ÿฅท ToolNinja