This tool runs entirely in your browser. No data is sent to any server.

URL Encoder & Decoder Online — Free, No Server, No Logs

Works offline No server calls No account GDPR-safe
Encoding Mode

What Is URL Encoding?

URL encoding (also called percent encoding) converts special characters in URLs into a % sign followed by two hexadecimal digits. For example, a space becomes %20, an ampersand becomes %26, and a hash becomes %23. This ensures URLs remain valid and unambiguous across all browsers, servers, and networking layers regardless of the characters they contain.

Why Is URL Encoding Needed?

URLs can only safely contain a limited set of ASCII characters. Characters like spaces, &, =, ?, #, and non-ASCII characters (accented letters, CJK characters, emoji) have special structural meaning in URLs or are not permitted at all. When these appear inside query string values, API parameters, or path segments, they must be encoded so routers and servers don't misinterpret them.

encodeURIComponent vs encodeURI — Which Should You Use?

JavaScript exposes two built-in encoding functions with an important difference:

  • encodeURIComponent() — Encodes everything except letters, digits, and - _ . ! ~ * ' ( ). Use this for individual query parameter values because it encodes ?, &, and =, which would otherwise break the query string structure.
  • encodeURI() — Leaves URL structural characters intact (? & = # /). Use this when encoding a full URL so the resulting string remains a valid, navigable URL.

Rule of thumb: if you're encoding a value that goes inside a query string, use encodeURIComponent. If you're encoding an entire URL, use encodeURI.

Common Use Cases

  • API query parameters — When building a URL like /search?q=hello world&lang=en, the value hello world must be encoded to hello%20world.
  • OAuth and redirect URIs — OAuth flows pass a redirect_uri parameter that itself is a full URL — it must be percent-encoded inside the outer URL.
  • HTML form submissions — Forms with method="GET" encode field values automatically; understanding this helps you debug unexpected + signs (spaces in form data become +, not %20).
  • Sharing URLs with special characters — URLs containing Chinese, Arabic, or accented Latin characters need to be encoded before being transmitted over HTTP.
  • Debugging encoded URLs — When a server logs or returns a percent-encoded URL, paste it here to decode it into something readable.

Common Characters and Their Encoded Forms

Quick reference for the characters you'll encounter most often:

Character Encoded Notes
Space%20Forms may use + instead
&%26Query string separator
=%3DKey=value separator
?%3FQuery string start
#%23Fragment identifier
+%2BWould be read as a space in query strings
/%2FPath separator
@%40Used in mailto: and auth URLs

URL Encoding in Other Languages

  • PHPurlencode() encodes a string for use in a query string (spaces become +). rawurlencode() follows RFC 3986 (spaces become %20). Use http_build_query() to encode entire parameter arrays.
  • Pythonurllib.parse.quote() for path segments, urllib.parse.quote_plus() for query string values.
  • cURL — Use --data-urlencode flag to automatically encode POST body values.

Privacy & Security

This tool processes everything locally in your browser. No URL, query string, or API key you paste here is ever transmitted to any server.

  • No server calls — Encoding and decoding use JavaScript's native encodeURIComponent and decodeURIComponent functions. Nothing leaves your tab.
  • Works offline — Once the page has loaded, disconnect from the internet and the tool keeps working.
  • GDPR-safe — No personal data is collected, processed, or stored. No cookies are set by this tool.

You can verify this by opening your browser's DevTools Network tab — no requests are made when you click Encode or Decode.

Built by TuringComplete
Check out our open-source developer tools.
Explore Tools