What Is URL Encoding (Percent-Encoding)?
URLs can only carry a limited alphabet reliably: letters, digits, and a handful of symbols (- _ . ~). Everything else — spaces, &, ?, #, é, emoji — must be written as percent-encoding: a % followed by the byte’s two-digit hexadecimal value. A space becomes %20, é becomes %C3%A9 (two UTF-8 bytes), and 😊 becomes %F0%9F%98%8A (four). RFC 3986 defines the scheme, and every server, browser, and API on the web speaks it. Encoding converts your data into that safe form; decoding reverses it back into readable text.
Reserved vs Unreserved Characters
The characters that make URLs work are the ones that make encoding tricky. Reserved characters have structural jobs: ? starts the query, & separates parameters, = assigns values, # starts the fragment, / separates path segments, + and : play their parts too. Inside a value you are writing (like a search term or a nested URL), any of these must be encoded — %26 for a literal & — or the server will read it as structure instead of data. Unreserved characters (A–Z a–z 0–9 - _ . ~) never need encoding, which is why clean slugs look the way they do.
encodeURIComponent vs encodeURI
JavaScript ships two encoders, and picking the wrong one is a classic bug. encodeURIComponent encodes everything except the unreserved set — it is for values: a single query parameter, a piece of text, a nested URL. encodeURI is for whole URLs: it deliberately preserves ://?&=# so the link stays navigable. Run encodeURI on a value and an ampersand sneaks through unencoded; run encodeURIComponent on a whole URL and the colons and slashes become %3A%2F%2F soup. This tool exposes both as “encode everything” vs “preserve structure” so the difference is one toggle, not a debugging session.
%20 vs +: Two Ways to Say “Space”
Spaces have two legal spellings and two separate histories. In URL paths, the standard is %20. In HTML form submissions (application/x-www-form-urlencoded, the GET encoding behind every search box) a space is written as +. They are not interchangeable in every context: some strict path parsers treat a literal + as a plus sign, and some form decoders never translate %20. Practical rule: query strings built from forms use +, everything else uses %20 — which is why this tool makes the choice explicit instead of guessing.
When Decoding Fails
Decoding goes wrong in two ways. First, malformed sequences: a stray % not followed by two hex digits (the classic 100% done typed into a field) is invalid encoding, and strict decoders throw — this tool catches the error and tells you instead of silently corrupting data. Second, the plus-sign question: %2B is a real plus, while a bare + usually means “space” — decode tools that treat every + as a space will mangle base64 values pasted into URLs. When a decoded string still looks encoded, you are looking at double encoding — see below.
Query Strings, UTM Parameters, and Analytics
Everything after the ? is a list of key=value pairs joined by &. The rule that matters: encode the values, never the separators. A campaign link like utm_source=news+letter&utm_campaign=spring%202025 survives mail merges and ad platforms; an unencoded space or ampersand inside a value truncates the parameter list mid-way and your analytics silently lose the campaign name. UTM values with spaces, ampersands, or non-ASCII characters are the most common source of broken tracking — encode them here before pasting into any ad platform.
Double Encoding: The Bug That Eats Redirects
Encoding is not idempotent: %20 encoded again is %2520 (the % itself became %25). Double encoding happens whenever a value passes through two layers that both encode — a redirect service wrapping a URL that an app already encoded, or a template that escapes a value you escaped yourself. The symptom: users land on your-site.com/redirect?url=https%3A%2F%2F…%3Fq%3Dcaf%25C3%25A9 and the inner page receives caf%C3%A9 instead of café. The fix is discipline: encode exactly once per layer, and decode with this tool repeatedly when untangling an existing mess — each pass strips one layer.
Step-by-Step: Using the URL Encoder/Decoder
- Paste your input. A full URL, a bare query string, or a plain text value.
- Pick the direction. Encode by default; hit the swap to decode.
- Choose the space style and scope. %20 + encode-everything for values; preserve-structure for whole URLs; + for form-style parameters.
- Read the live output as you type — 200 ms debounce keeps it snappy on long inputs.
- Copy the result into your link, config, or code. Decoding a mangled URL? Paste it in decode mode and watch it become readable.
Ready to Encode or Decode?
You know what percent-encoding is, when to reach for encodeURIComponent behavior vs encodeURI, why spaces have two spellings, and how to unwind double-encoded URLs. Scroll back up, paste your text, and convert it live — nothing leaves your browser.
