URLs, encoded
and decoded

Paste a URL or a single value to convert it either way. Choose the encoding rule that matches where the value is going, and see exactly what changed. Free, no sign-up required.

For a single query value or path segment. Encodes & = ? / : # so they cannot break the URL around them.

Input
0 characters
Output
0 characters

Features

Everything you need to work with encoded URLs, in one place.

Three encoding modes

Component, full URL, and form encoding are different rules. Pick the one that matches where the value is going.

Converts as you type

No button to press. Paste a value and the result is there, with character and byte counts alongside.

Query parameter breakdown

Paste a full URL and every parameter is split out and decoded, so you can read a long query string at a glance.

Runs in your browser

Nothing is uploaded. Tokens, signed URLs, and anything else you paste stay on your machine.

How to encode or decode a URL

Three steps, and the result updates as you go.

1

Pick a direction

Choose Encode to make text safe for a URL, or Decode to turn percent escapes back into readable characters.

2

Choose the mode

Component for a single value, Full URL for a whole address, Form for HTML form data. The hint below the buttons explains each.

3

Paste and copy

The result appears as you type. Copy it, or hit Swap to send the output back into the input and reverse the operation.

When you need this

The situations where an encoder saves the most time.

Debugging a broken link

A URL that works locally but 404s in production usually has an unencoded space, ampersand, or hash. Encode it and compare.

Reading an OAuth redirect

Redirect URIs nest a whole URL inside a query parameter. Decode it to see where a login flow is actually sending you.

Building API request strings

Search terms, email addresses, and file paths all need encoding before they go into a query string.

Inspecting tracking parameters

Campaign URLs carry long chains of utm values. The breakdown table shows what each one is really set to.

Understanding URL encoding

Why URLs have a restricted alphabet, what separates the three encoding rules, and the two mistakes that cause most encoding bugs: the ambiguous plus sign and accidental double encoding.

What percent-encoding actually does

A URL has a limited alphabet. Only unreserved characters (letters, digits, and the four marks - . _ ~) may appear literally anywhere. Everything else is either reserved, meaning it carries structural meaning, or simply not allowed.

Percent-encoding is the escape hatch. The character is converted to its UTF-8 bytes, and each byte is written as a percent sign followed by two hexadecimal digits. A space is byte 0x20, so it becomes %20.

The important consequence is that encoding operates on bytes, not characters. Anything outside ASCII produces more than one escape.

space  →  %20        (1 byte)
&      →  %26        (1 byte)
é      →  %C3%A9     (2 bytes)
😀     →  %F0%9F%98%80  (4 bytes)

This is why an encoded string is always longer than its source, and why the byte count matters when a system imposes a URL length limit.

Reserved characters and why the mode matters

Reserved characters are the ones that give a URL its shape: the colon after the scheme, the slashes between path segments, the question mark before the query, the ampersands between parameters, the hash before a fragment.

Whether those should be encoded depends entirely on what you are encoding. That single question is what separates the three modes, and getting it wrong is the most common URL bug there is.

  • ComponentYou are encoding one value that will sit inside a larger URL. Every reserved character must be escaped, otherwise your value hijacks the structure around it.
  • Full URLYou are encoding an entire URL that is already assembled. The structural characters must survive, or the result stops being a URL at all.
  • FormYou are producing the body or query of an HTML form submission. Same escaping as component, except a space becomes a plus sign.

Using full-URL encoding where you needed component encoding is the classic failure. A search term containing an ampersand silently splits into two query parameters, and the second half of the search vanishes.

The plus sign is ambiguous

In form encoding, a plus sign means a space. In every other part of a URL, a plus sign means a literal plus sign. The same character, two meanings, decided entirely by context.

This breaks things quietly. An email address like first+tag@example.com survives a normal path unchanged, but decoded as form data it turns into "first tag@example.com" and no longer matches any account.

"a+b" decoded as a component  →  a+b
"a+b" decoded as form data    →  a b

A literal plus is always safe to write as %2B. If you are generating URLs that carry email addresses or base64 values, encoding it explicitly removes the ambiguity before it can bite.

Double encoding

Encoding an already-encoded string escapes the percent signs themselves, so %20 becomes %2520. Decode that once and you get %20 back rather than a space, which is why a value can arrive looking almost right but not quite.

It happens most often when a value passes through several layers, each helpfully encoding on your behalf: a template helper, an HTTP client, and a proxy might each apply a round.

The signature is easy to spot once you know it. Sequences like %2520, %253A, or %2526 in a URL mean something has been encoded twice.

The fix is almost never to decode twice. Find the layer that is encoding redundantly and stop it, because a value that legitimately contains a percent sign will break under double decoding.

What JavaScript gets wrong

The built-in functions predate RFC 3986 and do not match it exactly. encodeURIComponent leaves five characters unescaped that the standard treats as reserved: ! ’ ( ) and *.

For most purposes that is harmless. It matters when you are building a signature or a canonical string that another system will verify, since AWS request signing and OAuth 1.0 both expect the stricter set.

encodeURIComponent("a!b*c")  →  "a!b*c"     // unchanged
strict RFC 3986              →  "a%21b%2Ac"

The Form mode in this tool applies the stricter rule, escaping those five characters as URLSearchParams does. If you are debugging a signature mismatch, that difference is a good first place to look.

Where encoding belongs

Encode values individually, at the point where you place them into a URL. Do not assemble a URL from raw pieces and encode the whole thing at the end, because by then the parser cannot tell your data apart from the structure.

In practice the platform usually does this better than manual string work. URL and URLSearchParams handle the escaping rules, and they get the edge cases right.

const url = new URL("https://example.com/search")
url.searchParams.set("q", "shoes & socks")
url.toString()
// https://example.com/search?q=shoes+%26+socks

Reach for a manual encoder when you are debugging, inspecting a URL someone sent you, or working somewhere without those APIs. For code that builds URLs, the platform objects are the safer default.

Common questions

What is URL encoding?

URL encoding, also called percent-encoding, replaces characters that are unsafe or reserved in a URL with a percent sign followed by their hexadecimal byte value. A space becomes %20 and an ampersand becomes %26. It lets arbitrary text travel inside a URL without changing that URL’s structure.

What is the difference between the three modes?

Component encoding escapes everything reserved, including & = ? and /, which is what you want for a single query value. Full URL encoding leaves those structural characters intact so an entire URL stays usable. Form encoding follows the rules browsers use when submitting an HTML form, where a space becomes a plus sign instead of %20.

Why does my decoded text show strange characters?

That usually means the text was encoded as one character set and decoded as another, or it was encoded twice. Percent-encoding operates on UTF-8 bytes, so a non-ASCII character like é becomes two escapes, %C3%A9. If you see é in the output, the bytes were decoded with the wrong encoding somewhere upstream.

Why do I get an error decoding a string with a percent sign?

A lone percent sign is not valid in an encoded string, because the decoder expects two hexadecimal digits after it. Text like "100% free" fails for this reason. If you want a literal percent sign in a URL it has to be written as %25.

Is my data sent to a server?

No. Encoding and decoding both happen in your browser using the standard built-in functions. Nothing you paste is transmitted, logged, or stored, which makes this safe for signed URLs and access tokens.

Explore more developer tools

Check out our other free tools for developers.

View all tools