What is URL encoding?

URL encoding represents characters with percent-prefixed UTF-8 bytes when they cannot safely appear in a URI context. A space becomes %20, while an at sign used as data becomes %40. Encoding preserves information; it does not encrypt or hide it.

encodeURI vs encodeURIComponent

Full URL encoding

encodeURI() preserves structural characters such as :, /, ?, and &. Use it when the input is already a complete URL.

Component encoding

encodeURIComponent() also encodes URL separators. Use it for an individual query value, path segment, or other piece of data.

URL encoding example

The component hello [email protected] becomes hello%20world%40example.com. The character breakdown shows only changed values and stops at a safe display limit for long input.

Common encoding mistakes

  • Encoding a complete URL as a component, which hides its separators.
  • Joining raw values into a query string without component encoding.
  • Decoding more times than the producer encoded.
  • Treating encoding as a security or authorization boundary.

Frequently asked questions

Why do spaces become %20?

A literal space is not a safe URI character, so its UTF-8 byte value 20 in hexadecimal is written as %20.

Does this tool open decoded URLs?

No. Results stay plain text. The tool never navigates to, fetches, or renders user input.