URL Encoder / Decoder

Percent-encode and decode URLs. Component, full-URL, and form modes. URL parts breakdown.

published

  • [FREE]
  • [NO_SIGNUP]
  • [NO_UPLOAD]

A URL encoder / decoder percent-encodes characters that aren’t safe in a URL. Browsers and HTTP servers expect ?q=hello world to be written ?q=hello%20world on the wire — this tool does that swap (and the reverse), with three flavors for different scenarios.

Privacy

encodeURIComponent, encodeURI, and decodeURIComponent are built-in JavaScript functions. Everything runs in your tab; nothing is uploaded.

Frequently asked questions

When should I use encodeURIComponent vs encodeURI?

Use `encodeURIComponent` for a single URL piece — a query value, a path segment. It escapes reserved chars like `&`, `=`, `/`, `?`. Use `encodeURI` only on a whole URL where you want to preserve the structure but escape spaces and a few other chars.

What is form-encoding?

The `application/x-www-form-urlencoded` MIME type that HTML forms POST by default. Spaces become `+` (not `%20`), and most non-alphanumerics are percent-encoded. The HTTP spec calls it the "form" variant of URL encoding.

Does the URL get sent anywhere?

No. Encoding and decoding both run as pure JavaScript in your browser. Nothing leaves the page.

What if my URL has Unicode?

Both `encodeURIComponent` and the form-encoder UTF-8 encode the bytes first, then percent-escape each byte. So `café` becomes `caf%C3%A9` — exactly what curl, browsers, and servers expect.