Skip to content
Devtools 360

Percent-Encode Text for URLs

Make text safe to put in a URL. Choose between encoding a single query value, a complete URL, or HTML form data, and the encoded result appears as you type.

Runs in your browserFree · No sign-up

How to URL-encode text

  1. Paste or type the text you want to place in a URL.
  2. Pick an encoding mode: Component for a single value, Full URL to keep the URL structure, or Form for application/x-www-form-urlencoded.
  3. Optionally tick "Encode each line separately" to encode a list of values.
  4. Copy the encoded output or download it as a text file.

Which mode should I use?

Use Component (encodeURIComponent) for anything you insert into a URL — a search term, a redirect target, a path segment — because it also escapes / ? & = and #. Use Full URL (encodeURI) only when you already have a complete URL with spaces or non-ASCII characters and want to keep its structure. Form mode matches how browsers submit HTML forms, with + for spaces. To reverse any of these, use the URL Decoder.

Benefits

  • Three standard encodings with a plain-language hint for each.
  • Non-ASCII characters are encoded as UTF-8 bytes, as required by RFC 3986.
  • Line-by-line mode is handy for encoding lists of parameters.

Limitations

  • Full URL mode cannot know whether a & or = inside a value is data or a separator, so encode values individually when in doubt.
  • Text containing unpaired surrogate characters cannot be encoded and shows an error.

Privacy and security

Encoding uses the browser's built-in encodeURIComponent and encodeURI functions. Your text stays on this device.

Read our privacy policy for details about the site as a whole.

Frequently asked questions

Should a space become %20 or +?

%20 is correct everywhere in a URL. + means a space only inside query strings that follow HTML form encoding, which is why Form mode uses it.

Why are letters and digits not encoded?

Unreserved characters — A–Z, a–z, 0–9 and - _ . ~ — are always safe in URLs, so encoding them would only make the URL longer.

What happens to emoji and accented letters?

They are converted to UTF-8 bytes and each byte becomes %XX. For example, é becomes %C3%A9.