toolo.dev

URL Encode Online

URL encode text online to percent-encoding like %20 and %C3%A9. Encode one query value (encodeURIComponent) or a whole link (encodeURI), UTF-8 throughout.

Encodes every character except A-Z a-z 0-9 - _ . ! ~ * ' ( ). Use it for a query value or a path segment.

About the URL Encoder

URL encode a value or a whole link to replace spaces, &, ?, # and non-English letters with percent-encoding such as %20 and %C3%A9. Choose Encode a value for one query parameter or path segment, or Encode a full URL to repair a link and keep its ://, ? and & working.

Percent-encoding is defined in RFC 3986. Text is first turned into UTF-8 bytes, and each byte outside the safe set is written as % plus two hex digits, so € becomes the three bytes %E2%82%AC. Both modes call your browser's own encodeURIComponent and encodeURI, which means the output matches what your JavaScript produces, and nothing you type is sent anywhere.

  1. Choose a mode first. The line under the two options lists the characters that mode leaves alone, so you know what to expect before you paste.
  2. Type or paste into Text to URL encode. Load sample depends on the mode: a price string like café & crème = 5€/kg? for Encode a value, and a search URL with spaces for Encode a full URL.
  3. Read Encoded text below. Line breaks are encoded too, as %0A, or %0D%0A for text copied on Windows, so remove a stray newline at the end before you copy.
  4. Building a query string by hand? Encode each key and value on its own and join them with = and & yourself. If you encode the finished a=1&b=2 in value mode, you get a%3D1%26b%3D2 and the server sees one long key.
  5. An error about a broken character (an unpaired surrogate) means the text holds half of an emoji, often because a string was cut at a fixed length in code. Delete that character and the output comes back.