Skip to content
Koit Academy

URL encoder and decoder

Your details

The details filled in are an example. Everything runs in this browser; nothing you type is sent anywhere or stored.

Encoded

3 of 3 lines encoded.

leaking%20tap%20repair%20%26%20parts
https%3A%2F%2Fwww.example.com%2Fsearch%3Fq%3Dboiler%20service%20%C2%A379
caf%C3%A9%2Fmenu%3Fday%3Dtoday
  • Note: A line starting with http:// was encoded as a single value, slashes and all. That is right when the whole URL is a parameter of another URL; for a link to use as it is, choose “Encode a whole URL”.

How to use it · free, no signup

How to use the URL Encoder and Decoder

Paste text or addresses, one per line, to percent-encode them as a value or a whole URL, or decode them back to plain text. Runs in your browser.

  1. 01

    Paste the text

    One value or URL per line; each line is handled on its own.

  2. 02

    Choose the mode

    Encode a value, encode a whole URL, or decode.

  3. 03

    Copy the result

    Lines that could not be decoded are left as they were and listed.

Why URLs need encoding

A URL may only contain a limited set of characters, and some of those have jobs: / separates the path, ? starts the query, & separates parameters. Anything else, including spaces, accented letters and currency signs, is written as % and two hexadecimal digits for each byte. The starting example encodes three lines as single values:

TextEncoded as a value
leaking tap repair & partsleaking%20tap%20repair%20%26%20parts
café/menu?day=todaycaf%C3%A9%2Fmenu%3Fday%3Dtoday
£79%C2%A379

A value or a whole address

The two encode modes do different jobs. Encoding a value, with encodeURIComponent, turns every character with a meaning in a URL into a %-code, so the value can be placed inside a URL without changing its structure; this is what a search term or a redirect address in a query string needs. Encoding a whole address, with encodeURI, leaves the structural characters alone and only fixes what cannot appear at all, such as spaces and accented letters.

Decoding, and what goes wrong

  • A lone percent sign. 100% does not decode, because % must be followed by two hexadecimal digits; a literal % is written %25.
  • Plus signs. In form data, + means a space. Turn on the option when decoding query strings from forms.
  • Double encoding. %2520 is a space encoded twice. Decode until the text stops changing.
  • Broken characters. A multi-byte character cut in half cannot be decoded, and the line is left as it was.

Encoding in campaign links

Campaign tags are the most common place encoding goes wrong: a campaign name with a space or an ampersand can break a link or split one tag into two. The UTM builder encodes each value for you, and the URL slug generator turns titles into addresses that need no encoding at all.

Published by Koit Academy. Who runs it, how it is paid and how its tools are checked.

Questions

What people ask about the URL Encoder and Decoder

What is URL encoding?
Writing characters that cannot appear in a URL as a % followed by two hexadecimal digits. A space becomes %20, an ampersand %26 and é %C3%A9.
What is the difference between encodeURI and encodeURIComponent?
encodeURI encodes a whole address and leaves the characters that structure it, such as / ? & and =, alone. encodeURIComponent encodes a single value, including those characters, so it can sit safely inside a URL.
Should a space be %20 or +?
%20 in the path of a URL. In query strings sent by HTML forms, a space is often written +; turn on the option to use or read it that way.
Why does my decoded text show an error?
A % must be followed by two hexadecimal digits. A literal percent sign, as in 100%, must be written %25 to decode cleanly.
Why did encoding turn % into %25?
Because the text was already encoded. Encoding twice breaks links; decode first if you are not sure.