URL encoder

Encode or decode full URLs and query-string values. Encode URI leaves + as +. Decode URI leaves %2B encoded.

Docify's URL tool percent-encodes a full URL with encodeURI (leaves reserved characters such as :/?#&=+ intact) or a single value with encodeURIComponent. A literal plus is reserved for encodeURI: hello+world stays hello+world; Encode component writes hello%2Bworld. Decode uses decodeURI or decodeURIComponent. decodeURI leaves that reserved sequence encoded: hello%2Bworld stays hello%2Bworld. decodeURIComponent of that same string becomes hello+world. Spaces become %20, not +. Nothing is uploaded.

Use encodeURI for full URLs, and encodeURIComponent for query parameters.
Plain URL
Encoded output

How it works

  1. Choose Encode or Decode. Paste a URL or a query value. Encode URI / Encode component (or the decode pair) and Copy stay in the browser.
  2. Encode URI runs encodeURI(input) so spaces and non-ASCII become UTF-8 percent-sequences, while reserved URI characters such as : / ? # & = + stay as delimiters. Encode URI on hello+world is hello+world. Encode component runs encodeURIComponent(input) so those characters are encoded as data, and that same string becomes hello%2Bworld. Load sample in Encode fills https://example.com/search?q=hello world&category=news and does not run either button. Encode URI then writes https://example.com/search?q=hello%20world&category=news; Encode component writes https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26category%3Dnews.
  3. Decode URI runs decodeURI(input) and leaves reserved percent sequences encoded: hello%2Bworld stays hello%2Bworld. Decode component runs decodeURIComponent(input) and that same string becomes hello+world. A literal hello+world stays hello+world under both decode buttons — not a space. Load sample in Decode fills https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26category%3Dnews: Decode URI yields https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello world%26category%3Dnews; Decode component yields https://example.com/search?q=hello world&category=news. Both throw on a malformed percent sequence (a lone % or a non-hex pair); the output then shows an error string.
  4. A space becomes %20, not +. This is not application/x-www-form-urlencoded. A literal plus is reserved for encodeURI (ECMA-262 uriReserved includes +): Encode URI leaves hello+world as hello+world; Encode component writes hello%2Bworld. Neither function encodes the marks !'()* (ECMA-262 / historical RFC 2396). Letters, digits, and -_.~ stay unescaped.

FAQ

Does this tool upload my text?
No. Encode, decode, and copy run in your browser. The page does not send the text to a server.
What is the difference between Encode URI and Encode component?
Encode URI runs encodeURI on the whole string and leaves reserved URI characters such as : / ? # & = + intact. Encode component runs encodeURIComponent, which percent-encodes those characters so a value is safe inside a path segment or query parameter. encodeURI("hello+world") is hello+world. encodeURIComponent of that same string is hello%2Bworld. Decode URI and Decode component are the matching decodeURI and decodeURIComponent calls. decodeURI("hello%2Bworld") stays hello%2Bworld. decodeURIComponent of that same string is hello+world.
Does this use + for spaces, like HTML form encoding?
No. encodeURI and encodeURIComponent emit %20 for a space. They do not implement application/x-www-form-urlencoded, where a space is + and a literal plus must be %2B. A literal + stays +: encodeURI("hello+world") is hello+world. Encode component writes hello%2Bworld. Both decode buttons leave hello+world as hello+world — not a space. decodeURI also leaves the reserved sequence %2B encoded.
Why did decode fail?
decodeURI and decodeURIComponent throw when a percent sequence is malformed (for example a lone % or a non-hex pair). The output box then shows an error string. They also do not decode a + as a space.

Related