URL Encode / Decode

Percent-encode or decode a URL query parameter, with a clear explanation of which function to use.

⏱ Updated: 18 Sep 2026

Calculator

Free URL encoder and decoder for percent-encoding a query parameter or path segment.

Switch modes to percent-encode a text value or decode a percent-encoded string.

How to Use the URL Encode / Decode Calculator

Toggle Encode or Decode, then paste text into the box — spaces, ampersands, and other special characters convert automatically, with a copy button on the result.

URL encoding — also called percent-encoding — replaces characters that either have a reserved meaning inside a URL or can't be safely transmitted in one with a %XX hex-escaped byte. A space becomes %20, an ampersand becomes %26, a forward slash becomes %2F. Browsers, servers, and just about every piece of software that touches URLs expect this for anything that isn't a plain letter, digit, or a small set of safe punctuation.

"Café & Co" → "Caf%C3%A9%20%26%20Co"

encodeURIComponent vs. encodeURI — Pick the Right One

This is a genuinely common mix-up for anyone who's looked at both functions in a language's docs and wasn't sure which one they needed. encodeURIComponent() encodes almost every character except letters, digits, and a handful of unreserved symbols — the right choice for a single value, like one query parameter, because it also escapes structural characters such as &, =, and /. encodeURI() deliberately leaves those structural characters alone, since it's meant for encoding a complete URL where /, :, &, and ? still need to do their job as delimiters.

Run encodeURI() on a single parameter that happens to contain an & and it won't escape it — which then gets read as a second parameter instead of part of the value, silently breaking whatever's on the other end. This calculator uses encodeURIComponent(), because encoding one value at a time is what it's built for.