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
- Choose Encode or Decode.
- Paste your text or URL — the result updates instantly.
- 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.