Skip to the tool

URL Encoder and Decoder

Percent-encodes and decodes URLs, and breaks a URL into scheme, host, path and query parameters. Handles the difference between encoding a whole URL and encoding a single component.

URL Encoder and Decoder

Escapes ? & = / # too — use this for a single value going into a query string.

Result

https%3A%2F%2Fexample.com%2Fsearch%3Fq%3Dhello%20world%26lang%3D%E0%B7%83%E0%B7%92%E0%B6%82%E0%B7%84%E0%B6%BD

This URL, broken up

Scheme
https
Host
example.com
Path
/search
Query parameters, decoded
ParameterValue
qhello world
langසිංහල

How to use it

  1. Paste a URL or a fragment of one into the box.
  2. Choose encode or decode.
  3. Use component encoding for a single query value — it escapes ampersands, slashes and question marks that would otherwise change the URL's structure.
  4. Use full-URL encoding when you have an entire address and want to keep its separators intact.
  5. Paste a complete URL to see it split into scheme, host, path and each query parameter separately.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?
encodeURI leaves URL separators like slash, question mark and ampersand alone, so it is for whole URLs. encodeURIComponent escapes them, which is what a single query value needs.
Why does a space become %20 sometimes and + other times?
Plus is a form-encoding convention from HTML form submissions, valid in a query string but not elsewhere. %20 is correct everywhere, which is why it is the safer choice.
Why does my decode fail with a malformed URI error?
A percent sign must be followed by two hex digits. A literal percent in text — a discount code, for instance — must itself be encoded as %25 before decoding will work.

Related tools

Kavitha Kanchana

Built and maintained by Kavitha Kanchana

Software engineer at Cortana AI and co-founder of Ryzera Technologies, based in Sri Lanka. Found a bug or a wrong number? Email me.