URL Encode and Decode Online
Percent-encode and decode URLs and query string values.
Use via API
Percent-encode or decode text for URLs. Send JSON, get JSON back.
POST https://pithlab.com/api/v1/tools/url-encoder-decoder
curl https://pithlab.com/api/v1/tools/url-encoder-decoder \
-H "Authorization: Bearer $PITHLAB_KEY" \
-H "Content-Type: application/json" \
-d '{"input":"running shoes & socks","mode":"encode"}'About the URL Encoder/Decoder
Percent-encode text for URLs and query strings, or decode encoded URLs back to readable text. Supports full URLs, components and + as space.
How to use the URL Encoder/Decoder
- Choose Encode or Decode.
- When encoding, pick Component for a single query value or path segment, or Full URL to keep characters like : / ? & = intact.
- When decoding a value from an HTML form, tick Treat + as space.
- Paste your input. The result updates as you type.
Examples
Input
fish & chips/café
Output
fish%20%26%20chips%2Fcaf%C3%A9
Input
https://example.com/a b?q=café
Output
https://example.com/a%20b?q=caf%C3%A9
Input
hello+world%21
Output
hello world!
Frequently asked questions
What is the difference between Component and Full URL encoding?
Component encoding (encodeURIComponent) escapes every character that has a special meaning in URLs, which is right for a single value. Full URL encoding (encodeURI) leaves the URL's structure characters alone so the URL still works.
Why does decoding fail?
A % must be followed by two hex digits, and multi-byte characters must be complete. A lone % or a truncated sequence such as %E0%A4 can't be decoded.
Should spaces be %20 or +?
%20 works everywhere in a URL. + only means a space in query strings produced by HTML forms (application/x-www-form-urlencoded).