WebToolX

Command Palette

Search for a command to run...

Developer Tools

URL Encode / Decode

Percent-encode or decode URLs and query strings instantly in your browser. Handles Unicode, special chars, and full URLs.

Paste text or a URL above — the encoded version appears here instantly.

URL Encode / Decode — Fast Percent-Encoding for Developers

Every time a browser sends a request, it relies on a strict set of rules to decide which characters are safe to include in a URL. Letters, digits, hyphens, underscores, periods, and tildes pass through unchanged. Everything else — spaces, ampersands, equals signs, Unicode letters, emoji, and control characters — must be converted to a percent-encoded form before the URL can travel safely across the internet. This tool does that conversion (and the reverse) instantly, in your browser, with no data sent to a server.

How to Use the Tool

  • Encode tab: paste any plain text, URL fragment, or query-parameter value into the input box. The encoded output appears immediately below as you type.
  • Decode tab: paste a percent-encoded string to recover the original text. If the input contains an invalid percent sequence (e.g. %GG), a clear error message is shown instead of a silent failure.
  • Hit Try an example on either tab to load a realistic sample — a French search query — so you can see the encoding in action before using your own data.
  • Click Copy to put the result on your clipboard with a single click.

What Gets Encoded

This tool uses the JavaScript built-in encodeURIComponent, which follows RFC 3986 and percent-encodes every character except the unreserved set: A–Z, a–z, 0–9, hyphen, underscore, period, and tilde. That means the following are all encoded:

  • Spaces → %20
  • Ampersands → %26, equals signs → %3D, question marks → %3F
  • Slashes → %2F, colons → %3A, hash signs → %23
  • Accented letters (é → %C3%A9), emoji (🚀 → %F0%9F%9A%80), and other Unicode

Common Use Cases

URL encoding comes up constantly in web development. Here are the situations where this tool is most useful:

  • Building a redirect URL where one URL appears as a query-parameter value of another (the inner URL must be fully encoded).
  • Debugging a 400 Bad Request caused by an unencoded special character in an API call's query string.
  • Constructing mailto: links with pre-filled subject lines and bodies that contain spaces and punctuation.
  • Decoding a percent-encoded string from server logs or a webhook payload to read the original value.
  • Encoding user-supplied search terms before appending them to a URL to avoid injection or truncation.

Privacy

All encoding and decoding runs entirely inside your browser using the native JavaScript encodeURIComponent and decodeURIComponent functions. No data is transmitted to any server at any point. You can safely paste API keys, personal information, internal URLs, or any other sensitive strings without concern.

Frequently Asked Questions

What is URL encoding?

URL encoding (also called percent-encoding) converts characters that are not allowed in a URL — such as spaces, ampersands, equals signs, and non-ASCII letters — into a safe format. Each unsafe byte is represented as a percent sign followed by two hexadecimal digits (e.g. a space becomes %20 and é becomes %C3%A9). This ensures the URL can be transmitted over HTTP without being misinterpreted by browsers or servers.

What is the difference between encodeURI and encodeURIComponent?

encodeURI is designed to encode a full URL and leaves structural characters like / : ? # & = unchanged because they have meaning in a URL. encodeURIComponent is more aggressive — it encodes those reserved characters too, making it the right choice for encoding a single query-parameter value or a path segment. This tool uses encodeURIComponent so every special character is safely encoded, which is almost always what you want when building or debugging query strings.

Why does %20 sometimes appear as a + in query strings?

The + sign as a space substitute comes from the older application/x-www-form-urlencoded encoding used by HTML forms. In that scheme, spaces are written as + and the + literal is written as %2B. Strict percent-encoding (RFC 3986) always uses %20 for spaces. Both forms are in common use, but %20 is unambiguous in all contexts. If you receive a + in a URL and need to decode it as a space, you'll need to replace + with %20 before decoding — this tool follows the RFC 3986 standard and treats + as a literal plus sign.

Does this tool handle Unicode characters like emojis and accented letters?

Yes. The tool first converts each Unicode character to its UTF-8 byte sequence, then percent-encodes each byte. For example, the French word café becomes caf%C3%A9 because é is encoded as the two-byte UTF-8 sequence C3 A9. Emojis become longer sequences — 🚀 for instance encodes to %F0%9F%9A%80. Decoding works in reverse, reassembling the UTF-8 bytes back into the original Unicode string.

When should I encode a full URL versus just the query parameters?

Encode a full URL only when you need to pass one URL as a value inside another (for example, a redirect parameter). In that case, the entire inner URL — including its scheme, slashes, and query string — needs to be encoded. For normal use-cases like building an API request, only encode the individual query-parameter values, not the delimiters (?, &, =) between them. Encoding the full URL would break those delimiters.

Related tools