URL Encoder / Decoder

Client-side only

Encode or decode URLs and query strings instantly. Supports full URL encoding and component encoding. All processing happens in your browser.

What is URL Encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed or have special meaning in a URL into a safe format. Each unsafe character is replaced with a percent sign followed by its two-digit hexadecimal ASCII code — for example, a space becomes %20.

URLs can only contain a limited set of ASCII characters. Characters like spaces, ampersands, question marks, and non-ASCII Unicode characters must be encoded to be safely transmitted in a URL. Without encoding, browsers and servers may misinterpret the URL structure.

There are two encoding modes: full URL encoding (encodeURI) preserves URL structure characters like /, ?, and &; component encoding (encodeURIComponent) encodes everything including those characters, making it safe for encoding individual query parameter values.

How to Use This Tool

  1. Choose Encode or Decode mode using the toggle buttons.
  2. Paste your URL or text into the input field on the left.
  3. The encoded or decoded result appears instantly in the output field.
  4. Toggle component mode to encode query string values individually — this encodes characters like &, =, and ? that would otherwise be treated as URL structure.
  5. Click Copy to copy the result to your clipboard.

Common Use Cases

Encoding Query Parameters

Encode values passed in query strings so special characters like & and = don't break URL parsing.

Building API Requests

Encode search terms, filters, and dynamic values before appending them to API endpoint URLs.

Fixing Broken Links

Decode a percent-encoded URL to read it as plain text, or encode a plain URL that contains spaces or special characters.

Form Data Submission

HTML forms with method=GET URL-encode field values automatically — decode them to inspect what was submitted.

Sharing URLs with Special Characters

Encode URLs containing accented characters, Chinese, Arabic, or other non-ASCII text for safe sharing.

Debugging Redirects

Decode redirect URLs that contain encoded destination paths to understand where a redirect is pointing.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?

encodeURI encodes a full URL and leaves structural characters like /, ?, #, and & intact. encodeURIComponent encodes everything including those characters, making it safe for individual query parameter values. Use encodeURIComponent when encoding a value that will be placed inside a query string.

Why is a space encoded as %20 sometimes and + other times?

In the path part of a URL, spaces are encoded as %20. In query strings (application/x-www-form-urlencoded format), spaces are often encoded as + for historical reasons. Both are valid in their respective contexts, but %20 is the standard percent-encoding.

What characters need to be URL encoded?

Characters that must be encoded include spaces, <, >, #, %, {, }, |, \, ^, ~, [, ], `, and non-ASCII characters. Characters with special URL meaning (/, ?, &, =, @) must be encoded when used as data values rather than URL structure.

Is URL encoding the same as HTML encoding?

No. URL encoding uses percent-encoding (%20 for space). HTML encoding uses named entities (&amp;amp; for &, &amp;nbsp; for non-breaking space). They solve different problems — URL encoding is for safe URL transmission, HTML encoding prevents XSS and markup conflicts.

Can I URL encode a full URL with query parameters?

If you want to pass a URL as a parameter value inside another URL, you should encodeURIComponent the entire inner URL. If you just want to encode a plain URL for safe use, use standard URL encoding which preserves the structural characters.