URL, HTTP & APIs

URL Encoder / Decoder

Percent-encode or decode full URLs and individual components. Choose the situation that matches your task — a query value or path segment, a whole URL, an HTML form field or strict RFC 3986 — then copy the result. Your input never leaves the page.

Runs in your browser v1.0.0

Mode

live
Direction

Input

0 chars

Result

0 chars

How it works

Each mode maps to a real-world situation. Query value / path segment uses encodeURIComponent() and is right for a single parameter value or one path segment. Full URL or query string uses encodeURI(), leaving reserved characters such as :, /, ?, & and # intact so the URL still works. Form field follows application/x-www-form-urlencoded: spaces become + and ~ ! ' ( ) are encoded, matching how an HTML form submits data. Strict RFC 3986 additionally encodes !, ', (, ) and *. Decoding mirrors these modes and reports invalid percent sequences as a friendly message instead of a browser exception. When decoding a query value you can also switch on “+ as space”. Everything is computed locally — nothing is sent to a server — and the mode and text can be shared through the URL fragment.

Practical uses

Percent-encode a URL or value, or decode percent-encoding back to text, using the mode that matches the job.

Common ways to use it

  • Escape a query-string value that contains spaces, ampersands or non-ASCII characters.
  • Encode one path segment without changing the slashes, question marks and ampersands that define the URL structure.
  • Decode a percent-encoded redirect target, callback URL or log line.

One value in the four encoding modes

Input

a b&c

Output

Query value / path segment (encodeURIComponent)   a%20b%26c
Full URL or query string (encodeURI)               a%20b&c
Form field (application/x-www-form-urlencoded)     a+b%26c
Strict RFC 3986 component                          a%20b%26c

Verified with the tool's own functions. The full-URL mode leaves & intact because it separates query parameters; the component modes encode it so the value cannot be split. The form mode writes a space as +.

Options that matter

  • Direction — encode or decode.
  • Function — query value/path segment, full URL, form field, or strict RFC 3986 for encoding.
  • Treat + as space — when decoding a query value whose spaces were sent as plus signs.

Things to keep in mind

  • Component and full-URL modes follow the browser's encodeURIComponent and encodeURI, so they encode UTF-8; the tool does not convert between legacy character sets.
  • Strict RFC 3986 additionally encodes ! ' ( ) * ; the plain component mode leaves those characters alone.
  • Decoding reports a friendly message for a lone % or an invalid sequence instead of throwing an error.