Forgly

URL Encode & Decode

Percent-encode text for URLs or decode it back. Runs locally in your browser.

Try an example:

What is URL encoding?

URL encoding (also called percent-encoding) replaces characters that aren't allowed in a URL with a % followed by their hexadecimal byte value. For example, a space becomes %20 and an ampersand becomes %26. This ensures the URL is transmitted and interpreted correctly.

When do you need it?

  • Passing values in query strings (e.g. search terms with spaces or symbols).
  • Encoding parameters that contain &, =, ?, or /.
  • Building safe links programmatically.
  • Decoding URLs from logs or analytics to read them.

encodeURIComponent vs encodeURI

This tool uses encodeURIComponent, which encodes a single URL component (like a query parameter value) and escapes characters such as &, =, and /. Use it for individual values rather than whole URLs.

Is my data safe?

Yes — encoding and decoding happen entirely in your browser.

Frequently asked questions

What's the difference between encodeURIComponent and encodeURI?

encodeURIComponent escapes a single value, including characters like the ampersand, equals, question mark, and slash — ideal for query-parameter values. encodeURI leaves those structural characters intact for encoding a whole URL. This tool uses encodeURIComponent.

Why does a space become %20?

Spaces are not allowed in URLs, so they are percent-encoded to their byte value, %20. The same applies to other reserved or unsafe characters.

Is it free and private?

Yes — it's free and unlimited, and encoding and decoding run entirely in your browser, so nothing is sent to a server.