URL encoder and decoder online

Encode and decode URLs online: percent-encoding with encodeURIComponent, query parameters in a table and IDN domains as punycode. Nothing is uploaded.

Direction
Method
85 characters

Encoded

99 characters
https://b%C3%BCcher.example/search?q=coffee%20and%20cake&city=Krak%C3%B3w&tag=new&tag=cheap#results

Every method at once

  • Parameter value (encodeURIComponent) also encodes / ? & = #
  • Whole URL (encodeURI) leaves / ? & = # as they are
  • Form, space as + how an HTML form sends it
  • Strict RFC 3986 also encodes ! ' ( ) *

How to use it in four steps

Step by step, with this page's example.

  1. 01

    Choose Encode or Decode. When you switch direction the result moves into the field, so checking both ways is easy.

  2. 02

    Pick a method. Parameter value is for what goes after the = sign, Whole URL is for a finished link.

  3. 03

    Paste the text or URL. You see the result of every method at once, with your pick highlighted.

  4. 04

    For a full URL, check its parts, the query parameters in the table and the punycode form of the domain.

What you enter

coffee & cake, method Parameter value

What you get
coffee%20%26%20cake
Without encoding, the & would split this value into two parameters.

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.

Tell us what you want to build.

A free quote comes back within an hour during working hours. You talk to the person who writes the code.