What is URL encoding?

URL encoding, also called percent-encoding, writes characters that can't appear in a URL as a percent sign and two hexadecimal digits. A space becomes %20, an ampersand %26, and é, which takes two bytes in UTF-8, becomes %C3%A9. Decoding turns these sequences back into the characters.

Tool description

Type or paste text into the Decoded field to get it encoded as you type. To decode, switch the direction with the swap button or pick Encoded as the source. Then pick the format:

  • URL component: for one part of a URL, such as a query value or a path segment. Everything but letters, digits and - _ . ! ~ * ' ( ) is encoded, including / ? & = #, like JavaScript's encodeURIComponent.
  • Whole URL: for a complete address. It keeps the characters that give a URL its structure, such as : / ? # & =, and encodes spaces and other characters, like encodeURI. Decoding leaves escapes such as %2F and %3F as they are, so the URL keeps its meaning.
  • Form data: the application/x-www-form-urlencoded format of HTML forms and URLSearchParams. Spaces become plus signs, and only letters, digits and * - . _ stay as they are. Decoding turns plus signs back into spaces.

Text is encoded as UTF-8, so letters with accents and emoji become their bytes. When decoding, a percent sign without two hexadecimal digits after it, or bytes that don't spell a UTF-8 character, show an error that names the character position to fix.

Examples

  • sunny days & ice cream as a URL component: sunny%20days%20%26%20ice%20cream
  • The same text as form data: sunny+days+%26+ice+cream
  • https://example.com/a b?q=é as a whole URL: https://example.com/a%20b?q=%C3%A9
  • %F0%9F%91%8B decoded: 👋

Features

  • Encodes and decodes as you type
  • URL component, whole URL and form data rules
  • UTF-8 for every language and emoji
  • Errors that point to the character to fix
  • Runs in your browser, so the text never leaves your device