URL Encoder/Decoder

Encode and decode URLs, query strings, and URI components. Supports encodeURIComponent and encodeURI with URL parser and query parameter inspector: all client-side.

URL Encoder/Decoder

Encode and decode URLs, query strings, and URI components

encodeURIComponent: Encodes all special characters. Use for query parameters, form data.

encodeURI: Preserves URI structure (://?#). Use for full URLs.

Characters: 0

URL Encoding Guide

Free URL Encoder and Decoder Online

A URL encoder converts special characters in URLs to their percent-encoded form so they can be safely transmitted over the internet. URLs may only contain ASCII characters: spaces, ampersands, equals signs, and non-ASCII letters must be encoded as a percent sign followed by two hexadecimal digits (space = %20, & = %26, = = %3D). Encoding errors are a common cause of broken API requests, failed redirects, and security vulnerabilities.

Common characters and their URL-encoded equivalents

  • Space: %20 (or + in form data)
  • & (ampersand): %26
  • = (equals): %3D
  • + (plus): %2B
  • / (slash): %2F
  • ? (question mark): %3F
  • # (hash): %23
  • @ (at): %40

encodeURIComponent vs encodeURI

  • encodeURIComponent: Encodes ALL special characters including / ? # & =. Use this for individual query parameter values when building API request URLs.
  • encodeURI: Preserves URL structure characters like / ? # & = while encoding spaces and non-ASCII characters. Use this for complete URL strings.

How to encode or decode a URL

  1. Paste your URL or query string into the input field.
  2. Choose Encode or Decode and select the encoding mode.
  3. The result appears instantly with statistics on characters encoded.
  4. Use the URL Parser tab to break any URL into protocol, hostname, path, query params, and hash fragment.
  5. Copy individual URL components or the full result to clipboard.

Developer use cases

  • API requests: Encode query parameter values before appending them to a URL to prevent broken requests.
  • Redirect debugging: Decode a multi-encoded redirect URL to find the final destination.
  • OAuth and JWT: Decode redirect_uri and state parameters in OAuth flows.
  • Web scraping: Encode search terms and filters when constructing target URLs programmatically.

Query strings are the bread and butter of REST calls. See which public APIs accept keys as query parameters, for example the currency exchange APIs.

Frequently Asked Questions

When should I use encodeURIComponent instead of encodeURI?

Use encodeURIComponent for a single value that goes into a query string or path segment: it encodes every reserved character, including / ? & = #. Use encodeURI for a complete URL you want to keep intact, since it leaves the structural characters alone and only encodes spaces and non ASCII characters.

Why is a space sometimes %20 and sometimes +?

Percent encoding writes a space as %20. HTML forms submitted as application/x-www-form-urlencoded write it as +, and many servers decode + as a space only in the query string. When decoding form data tick Treat + as space; when encoding a value for a form, tick Space as +.

How do I decode a URL that was encoded twice?

Double encoding shows up as %2520 (a percent sign encoded as %25 followed by 20). Tick Decode repeatedly and the tool decodes until the text stops changing, reporting how many passes it needed. Redirect and tracking URLs often need two or three.

Why does decoding fail with URI malformed?

A percent sign that is not followed by two hex digits, or a byte sequence that is not valid UTF-8, breaks decodeURIComponent. The tool then decodes the valid escapes and leaves the rest as it is, so you can still read the URL and spot the broken part.

Free forever, no ads, no tracking. Support the project