URL Encoder and Decoder

Paste text or a URL and see the encoded or decoded version right away, using the percent-encoding (%20, %C3%A7) that browsers use.

Action
Format
Result

https://exemplo.com.br/busca?q=ação rápida&cidade=São Paulo

What URL encoding is

A URL can only contain a small set of ASCII characters. Spaces, accents and symbols such as & and # become a % followed by two hexadecimal digits for each UTF-8 byte. The letter "ç" becomes %C3%A7 and a space becomes %20.

That is why an address copied from a browser is often full of % signs. Decoding shows the original text, and encoding prepares a value to go into a URL safely.

Which format to pick

  • Component (encodeURIComponent): for a single value, such as the content of a parameter. It encodes / ? & = # and anything else that could break the URL.
  • Full URL (encodeURI): for a whole address. It leaves / ? & = # and : as they are and encodes only spaces, accents and other invalid characters.
  • Form: the same as the component format, except that a space becomes +. This is the format of HTML forms and URLSearchParams.

Common mistakes

  • Encoding a whole URL as a component, which turns https:// into https%3A%2F%2F and breaks the link.
  • Encoding twice. The % becomes %25 and %20 turns into %2520. If %25 shows up in the result, the text was already encoded.
  • Decoding a form value as a component. The + stays a + instead of becoming a space.

URL Encoder and Decoder FAQ

The difference between formats, spaces and decoding errors.