Skip to content

Other

URL Encode/Decode

Enter your values and the result updates as you type. The formula and a worked example are below the calculator.

Convert

For one piece of a URL, such as a query value or a path segment. Encodes ; , / ? : @ & = + $ # as well.

Characters in
20
Characters out
150
Percent codes written
50

Common characters and their codes

CharacterNamePercent code
Space%20
!Exclamation mark%21
"Double quote%22
#Hash%23
$Dollar%24
%Percent%25
&Ampersand%26
+Plus%2B
,Comma%2C
/Slash%2F
:Colon%3A
;Semicolon%3B
<Less than%3C
=Equals%3D
>Greater than%3E
?Question mark%3F
@At sign%40
^Caret%5E
₹Rupee sign%E2%82%B9
ΩOmega%CE%A9

How to use

  1. Choose Encode or Decode and type or paste your text. The result updates as you type.
  2. When encoding, pick what you are encoding: one value (such as a search term), a whole address, or form data where a space becomes +.
  3. When decoding, switch on the plus option if the text comes from an HTML form and a + means a space.
  4. Copy the result, or use it as the new input to check that decoding gets back the original.

Formula

Letters, digits and - . _ ~ are safe and stay as they are. Every other character is turned into its UTF-8 bytes and each byte is written as a percent sign and two hex digits (RFC 3986). One-value encoding also changes the reserved characters ; , / ? : @ & = + $ #, which have a meaning inside a URL.

Example

The text hello world & more? becomes hello%20world%20%26%20more%3F. The Devanagari word नमस्ते becomes %E0%A4%A8%E0%A4%AE%E0%A4%B8%E0%A5%8D%E0%A4%A4%E0%A5%87, because each letter takes three UTF-8 bytes.

Percent-encoding makes text safe to put in a URL; it does not hide it. Spaces at the start and end are trimmed before converting. Decoding fails on a % that is not followed by two hex digits, or on bytes that are not valid UTF-8.