Encoding

URL Encode/Decode

Percent-encode or decode text for a query string, path segment, or full URL. Runs entirely in your browser; nothing you type is ever sent anywhere.

Plain Text
Encoded
Encoded output will appear here.

Quick Learn

URL (percent) encoding replaces any character a URL isn't allowed to contain literally — spaces, &, #, +, non-ASCII letters — with a % followed by its two-digit hex byte value, so it can safely travel inside a query string, path segment, or full address without being misread as part of the URL's own structure. Decoding reverses that: every %XX sequence turns back into the byte it represents.

JavaScript actually gives you two different functions for this, and picking the wrong one is a common bug source. encodeURIComponent() escapes everything unsafe, including &, =, and / — use it for a single value going into a query parameter, like a search term or a redirect target. encodeURI() assumes you're encoding an entire URL and deliberately leaves & = / : ? # alone, since those are meant to keep their structural role — use it only when you have a whole URL, not a single field. Mixing them up is exactly how a query parameter containing an & ends up silently splitting into two parameters.

Best Practices

  • •Default to Component mode for anything going into a single query parameter or path segment — Full URL mode intentionally leaves & = / ? # unescaped, which breaks a parameter value that itself contains those characters.
  • •A + in a query string traditionally means a space (from the older application/x-www-form-urlencoded convention) — but encodeURIComponent() always uses %20 for spaces, never +. If you're decoding a classic form submission, replace + with a space before percent-decoding.
  • •Encode each value separately before assembling a URL, rather than building the full URL string first and encoding it once — encoding a complete URL with encodeURIComponent() would also escape the :// and / you need to keep.
  • •A stray % not followed by two valid hex digits is the most common decode failure — it usually means the text was already decoded once, or wasn't URL-encoded to begin with.

More Encoding Tools

See all Encoding tools

Frequently Asked Questions

Is my text uploaded anywhere?

No. Encoding and decoding both run entirely in your browser using JavaScript's native encodeURIComponent/decodeURIComponent — nothing you paste is sent to a server.

What's the difference between Component and Full URL mode?

Component mode (encodeURIComponent) escapes every character that isn't safe in a single value, including & = / — use it for one query parameter or path segment. Full URL mode (encodeURI) assumes you already have a complete URL and leaves structural characters like : / ? # & = alone so the URL still parses correctly.

Why does my decoded output still have %20 or a raw +?

A %20 that survives decoding usually means the input wasn't actually percent-encoded, or was double-encoded (%2520 decodes once to %20, not a space). A literal + is decoded as a plus sign by decodeURIComponent — it's only a space under the older form-encoding convention, which this tool doesn't assume automatically.

Why did decoding throw an error?

decodeURIComponent throws on malformed percent-encoding — most often a % that isn't followed by exactly two hex digits. Check for a stray % in the original text, or that the input wasn't truncated during copy-paste.

Does this handle non-English characters and emoji?

Yes — both encode and decode operate on the underlying UTF-8 bytes, so accented letters, CJK text, and emoji all round-trip correctly.

Want the engineering deep-dives behind tools like this one?