Type or paste some text.
Encoded
99 charactershttps://b%C3%BCcher.example/search?q=coffee%20and%20cake&city=Krak%C3%B3w&tag=new&tag=cheap#results
encodeURI writes the letters of a domain as %XX, while browsers and DNS use punycode. Take a URL with an IDN domain from the How a browser writes it line.
The result still has % sequences, so the text was most likely encoded twice.
Every method at once
- Parameter value (encodeURIComponent)
- Whole URL (encodeURI)
- Form, space as +
- Strict RFC 3986
- How a browser writes it
URL parts
- Protocol
- Domain
- Port
- Path
- Fragment after #
Query parameters
| Number | Key | Value |
|---|
IDN domain
- ASCII form (punycode)
- Form with native letters
This domain cannot be converted to punycode. Check it for spaces or characters that are not allowed.
How to use it in four steps
Step by step, with this page's example.
- 01
Choose Encode or Decode. When you switch direction the result moves into the field, so checking both ways is easy.
- 02
Pick a method. Parameter value is for what goes after the = sign, Whole URL is for a finished link.
- 03
Paste the text or URL. You see the result of every method at once, with your pick highlighted.
- 04
For a full URL, check its parts, the query parameters in the table and the punycode form of the domain.
coffee & cake, method Parameter value
coffee%20%26%20cake Questions
- What is URL encoding?
- URL encoding (percent-encoding) replaces unsafe characters in a link with % and two hex digits, so a space becomes %20 and ü becomes %C3%BC. This tool encodes and decodes text four ways and splits a query string into parameters.
- encodeURIComponent or encodeURI?
- encodeURIComponent for a single value, such as what you put after q=. It also encodes / ? & = #, so the value cannot break the URL. encodeURI for a whole URL that already has those characters in place. A whole link run through encodeURIComponent starts with https%3A%2F%2F and stops working.
- Is a space %20 or +?
- In a URL a space is %20. A plus means a space only in form data, the application/x-www-form-urlencoded format. That is why the Form decoding turns + into a space, while Parameter value leaves the plus alone.
- Where do sequences like %C3%BC come from?
- They are UTF-8 bytes. The letter ü takes two bytes in UTF-8, C3 and BC, so it is written %C3%BC, and each byte in a URL is written as % and two hex digits.
- What is punycode?
- A way to write a domain with native letters in plain ASCII, the only characters DNS understands. Such a domain starts with xn--, for example bücher.example becomes xn--bcher-kva.example. The browser usually shows the version with letters but sends the punycode.
- What does the invalid UTF-8 error mean?
- The text was encoded in a charset other than UTF-8, often Windows-1252 or ISO-8859-1, where é is %E9. JavaScript functions expect UTF-8, so a URL like that has to be fixed in the system that produced it.
- Does the text go to a server?
- No. Encoding, URL parsing and punycode all run in your browser with no network request, so you can paste a URL with a token or customer data in it.