Skip to content
SyntaxSnap

URL Encode and Decode

Percent-encode text for use in a URL, decode encoded strings, and see any URL broken into its base, query parameters and hash.

Input

Encoded

https%3A%2F%2Fapi.example.com%2Fsearch%3Fq%3Dcaf%C3%A9%20%26%20bar%26tags%3Da%2Cb%26redirect%3D%2Fhome%3Ftab%3D1

URL parts

basehttps://api.example.com/search
qcafé
bar(empty)
tagsa,b
redirect/home?tab=1

How to encode or decode a URL

  1. Step 1

    Choose a direction

    Pick Encode or Decode. For encoding, choose Query value or Full URL.

  2. Step 2

    Paste your text

    Paste the URL or value. The result updates as you type.

  3. Step 3

    Copy the result

    Copy the output, and check the URL parts table for each parameter.

Query value or full URL

Use Query value (encodeURIComponent) for a single parameter value: it also encodes &, =, ? and /, so the value cannot break the URL around it. Use Full URL (encodeURI) when you have a complete address and only want spaces and non-ASCII characters escaped.

Plus signs and spaces

HTML forms encode spaces as +, while most APIs use %20. The decoder treats both as a space.

Reading query strings

When the input is a full URL, the parts table lists every query parameter already decoded, which is quicker than reading a long tracking link by eye.

Questions and answers

What is percent-encoding?

It replaces characters that are not allowed in URLs with a % followed by two hex digits, so a space becomes %20 and é becomes %C3%A9.

Which encoding should I use for API parameters?

Query value. It escapes characters such as & and = that would otherwise split the parameter.

Is anything uploaded?

No. Encoding, decoding and parsing all run in your browser.

Next step

Need this built into your stack?

The team behind SyntaxSnap builds custom code generators, internal developer tools and API integrations.