SHA1Generator

URL Encoder/Decoder

Encode and decode URLs instantly with percent encoding

URL Component: Encodes query parameters and path segments.
Full URL: Encodes the entire URL.

What is URL Encoding?

URL encoding (percent-encoding) converts characters that are unsafe in URLs into their %HH hexadecimal form. This ensures URLs can be transmitted and parsed reliably across browsers and servers.

UUID versions

  • v1: Timestamp-based with node info; predictable order but may leak host details.
  • v4: Random-based; collisions are astronomically unlikely with 122 bits of randomness.
  • v7: Time-ordered; good for indexing while preserving randomness.

encodeURI vs encodeURIComponent

  • encodeURI encodes an entire URL and preserves separators like :, /, ?, #.
  • encodeURIComponent encodes individual components (e.g., query values, path segments) where separators must be escaped.

Common pitfalls

  • Always encode non-ASCII characters and reserved characters in components.
  • Double-encoding breaks URLs-only encode once per component.
  • Normalize inputs to avoid ambiguous parsing on the server.

FAQs

encodeURI vs encodeURIComponent?

Use encodeURI for full URLs (keeps separators like :/?#&) and encodeURIComponent for individual components (encodes most special characters including spaces).

How do I decode percent-encoding?

Use decodeURIComponent for components and decodeURI for full URLs. This tool supports both directions to help debug malformed links.

Why do spaces become + in query strings?

In application/x-www-form-urlencoded bodies and query strings, spaces may be serialized as +. Raw percent-encoding uses %20. Decode based on your server's expected format.