Skip to content

URL Encode / Decode

Percent-encode or decode query strings and URL components safely.

Output

How to use the URL Encode / Decode

  1. Choose Encode or Decode.

  2. Pick Component mode for a single query value, or turn it off for a full URL.

  3. Paste your text or URL and copy the converted output.

What is URL (percent) encoding?

URLs can only safely carry a limited ASCII subset — letters, digits, and a handful of punctuation marks (- _ . ~). Everything else — spaces, &, ?, #, %, non-ASCII text — gets replaced with a percent sign followed by its two-digit hex byte value, e.g. a space becomes %20 and é (UTF-8 bytes 0xC3 0xA9) becomes %C3%A9. JavaScript actually exposes two different encoders for this, and mixing them up is the single most common URL-encoding bug: encodeURIComponent() escapes everything that isn't safe inside one value, including / ? & = — use it for a single query parameter or path segment. encodeURI() assumes you're handed a complete URL already and leaves / : ? & = # alone so the URL doesn't fall apart, only escaping things like spaces and non-ASCII characters. This tool exposes both as "Component" and "full-URL" mode, so you can match whichever one your code actually uses.

For a step-by-step walkthrough, read our guide: URL Encoding Explained: Percent-Encoding for Web Developers.

Key features

  • Toggle between component-safe (encodeURIComponent) and full-URL (encodeURI) modes
  • Encode and decode percent-encoding in either direction
  • Handles non-ASCII characters correctly via UTF-8 byte encoding
  • Instant conversion as you type, fully private

Frequently asked questions

What's the real difference between component and full-URL encoding?

encodeURIComponent (component mode) escapes / ? & = # so a value like "a/b&c" survives as one query parameter without breaking the URL structure. encodeURI (full-URL mode) leaves those characters alone because it assumes they're already doing their job as URL syntax — use it on a whole URL, not a single value.

Why do spaces sometimes become %20 and sometimes +?

%20 is the general percent-encoding for a space anywhere in a URL. The + form is specific to the application/x-www-form-urlencoded content type used by HTML form submissions and query strings — this tool produces %20, which is valid everywhere.

Why does decoding sometimes throw an error?

A malformed percent sequence — a stray % not followed by two valid hex digits, or a cut-off multi-byte UTF-8 sequence — makes decodeURIComponent throw. Check for truncated copy-pasting from the source.

Is my URL or query string sent anywhere?

No — encoding and decoding run locally via the browser's built-in encodeURIComponent/decodeURIComponent, nothing leaves your device.