URL Encoder / Decoder

What Is URL Encoding?

URLs may only contain a limited set of characters, so anything else — spaces, accents, &, ?, = and more — must be "percent-encoded" (e.g. a space becomes %20). Doing this by hand is error-prone, and a single unescaped character can break a link or an API call. This free URL Encoder / Decoder converts text to and from percent-encoding instantly in your browser, for both single components and whole URLs.

URL encoding (also called percent-encoding) converts characters that are not allowed in a URL — spaces, special symbols, non-ASCII letters — into a % followed by two hexadecimal digits representing the character's byte value. For example, a space becomes %20, the at-sign @ becomes %40 and an em dash becomes %E2%80%94. This ensures that URLs remain valid and unambiguous regardless of the characters in a query string or path segment.

How to use the URL encoder

  1. Choose Encode or Decode.
  2. Paste your text or URL — the result updates instantly.
  3. Toggle "Whole URL" to preserve URL syntax characters, then copy the output.

Use Cases

  • Encoding a search query or form field value before appending it to a URL as a query parameter.
  • Decoding a percent-encoded URL to read the actual parameter values it contains.
  • Fixing broken URLs that contain unencoded spaces or special characters.
  • Building API requests that include user-generated content in the URL.

How URL Encoding Works

JavaScript's encodeURIComponent() encodes a string by converting each unsafe character to its UTF-8 byte sequence and then percent-encoding each byte. Unreserved characters (letters, digits, -, _, ., ~) are left as-is. Reserved characters like /, ?, # and & — which have special meaning in URLs — are also encoded when using encodeURIComponent, making it safe for encoding individual parameter values.

Decoding reverses the process: decodeURIComponent() reads each %xx sequence, converts the hex pair back to a byte value and reconstructs the original UTF-8 string. If you need to encode an entire URL (preserving its structure) rather than a single value, encodeURI() is the right function — it leaves reserved characters intact.

Why use this tool

  • Handles both single components and full URLs.
  • Instant, two-way conversion with one-click copy.
  • Runs entirely in your browser — private and free.

Privacy

Encoding and decoding run entirely in your browser. The URLs and strings you enter are never sent to our servers.

FAQ

When should I URL-encode text?

Encode any value placed in a URL — query parameters, path segments or fragments — so characters like spaces, &, ? and = do not break the link.

What is the difference between the two modes?

By default it encodes a single component (encodeURIComponent). Tick "Whole URL" to keep URL syntax characters (:/?&=) intact while encoding the rest.

Is my text sent anywhere?

No. Encoding and decoding run entirely in your browser.

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves reserved characters (/, ?, #, &, =, :) intact because they are structural. encodeURIComponent encodes a single value and converts those same characters, making it safe to embed in a query string. Use encodeURIComponent for parameter values; use encodeURI only when encoding an entire URL.