Skip to main content

URL Encode / Decode

Loading…

About URL Encode / Decode

The URL Encoder / Decoder converts special characters to percent-encoded sequences (%xx) or decodes percent-encoded sequences back to readable text. It is an essential utility when working with query strings, form data, API parameters, redirect URLs, and URL path segments.

Characters with special meaning in URL syntax — spaces, &, =, +, ?, #, and all non-ASCII characters — must be percent-encoded to be transmitted safely. Without encoding, these characters break the URL structure and cause query parameters to be parsed incorrectly. This tool handles both modes: Full URL encoding (preserves structural characters like /, ?, &, and = so the URL remains navigable) and Component encoding (encodes everything including structural characters, suitable for individual parameter values).

A common workflow: when building a URL like https://example.com/search?q=hello world&tag=c#, the query value 'hello world' and the hash fragment must be component-encoded before being inserted, while the base URL structure is preserved with full URL encoding.

The encoder/decoder also correctly handles Unicode and non-ASCII characters, converting them to their UTF-8 byte sequences before percent-encoding — the correct approach per RFC 3986.

Everything runs entirely in your browser. Your URLs and data are never sent to a server.

Practical Uses for URL Encode / Decode

  • Encode a query parameter value before appending it to a URL
  • Decode a percent-encoded redirect URL from a log file
  • Build a mailto: link with an encoded subject and body
  • Encode special characters in a search query for an API request
  • Decode a webhook payload URL to inspect its parameters
  • Encode a file path segment containing spaces or symbols

How to Use URL Encode / Decode

  1. Paste your URL or text string.

  2. Select Encode or Decode.

  3. Choose Full URL mode (preserves /, ?, &, =) or Component mode (encodes everything).

  4. Copy the result.

Examples

Example — Encode URL with spaces
Input
https://example.com/search?q=hello world&lang=en
Output
https://example.com/search?q=hello%20world&lang=en
Example — Decode percent-encoded string
Input
Hello%20World%21%20How%27s%20it%20going%3F
Output
Hello World! How's it going?
Example — Encode a mailto subject line
Input
Question about my order #1234
Output
Question%20about%20my%20order%20%231234
Example — Decode a redirect URL
Input
https%3A%2F%2Fexample.com%2Flanding%3Fref%3Dnewsletter
Output
https://example.com/landing?ref=newsletter

Who Uses the URL Encode / Decode Tool

  • Developers encode query parameters and path segments correctly before building API requests.
  • Marketers build and decode tracking URLs with encoded UTM parameters and redirect targets.
  • QA engineers decode percent-encoded values from server logs while debugging a request.
  • SEO professionals inspect and decode encoded characters in crawled or redirected URLs.
  • Support teams decode confusing percent-encoded URLs pasted into a support ticket.

Comparisons

encodeURI vs encodeURIComponent

These two JavaScript functions (and this tool's Full URL vs Component modes) serve different purposes. encodeURI is meant for encoding a complete URL you already have — it leaves structural characters like /, ?, and & alone so the URL keeps working, and only encodes things like spaces and unsafe characters.

encodeURIComponent is meant for encoding a single value that will be inserted into a URL, such as a query parameter — it encodes everything, including /, ?, and &, since those characters would otherwise break the URL structure if they appeared inside a value. Using the wrong one is a common source of broken links and mis-parsed query strings.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL, preserving structural characters like /, ?, &, and =. encodeURIComponent encodes individual parameter values, also encoding those structural characters.

Why is a space encoded as %20 in some cases and + in others?

%20 is the standard percent-encoding for a space in URLs. The + encoding for spaces is specific to HTML form data (application/x-www-form-urlencoded) and should not be used in URL paths.

Which characters get percent-encoded?

Any character outside the unreserved set (letters, digits, -, _, ., ~) gets encoded. In component mode, structural URL characters (/, ?, &, =, #, :) are also encoded.

Can I decode a URL with multiple percent-encoded characters?

Yes — the decoder handles any number of %xx sequences in a single pass, including sequences like %20, %2F, %3D, %26, etc.

How do I encode a URL query parameter value?

Use Component mode (encodeURIComponent equivalent) to encode the value. This encodes characters like &, =, and + that would otherwise break the query string structure.

Why did my URL break after encoding?

This usually happens when Full URL mode is used on a value that should have been Component-encoded, or vice versa. If you're encoding a complete URL, use Full URL mode; if you're encoding one parameter value, use Component mode.

Can I encode a mailto: link with a subject and body?

Yes — component-encode the subject and body text separately, then build the link as mailto:[email protected]?subject=ENCODED_SUBJECT&body=ENCODED_BODY.

Does this handle non-English characters in a URL?

Yes — non-ASCII characters are converted to their UTF-8 byte sequence and then percent-encoded, which is the correct approach per RFC 3986 and how modern browsers handle internationalized URLs.