All tools

URL Encoder / Decoder

Percent-encode or decode URLs and query parameters.

  • url
  • percent
  • encode
  • decode
  • uri

About URL Encoder / Decoder

URLs can only contain a restricted set of characters safely — letters, digits, and a handful of punctuation marks. Anything else (spaces, accented characters, emoji, ampersands inside a query value) has to be percent-encoded: each unsafe byte gets replaced with a % followed by two hexadecimal digits. That's why a search for "café & pastries" in a URL shows up as %20caf%C3%A9%20%26%20pastries.

The trick is that you usually want to encode the values inside a URL (like a search query) without breaking the URL structure itself (the slashes, the ? and the & separators between parameters). This tool offers both modes — "component" encoding for values, "whole URL" encoding when you want to escape only the truly unsafe characters and leave the URL syntax alone.

How to use

Pick a direction with the Encode/Decode toggle. In encode mode, type or paste your text into the input and the encoded version appears below. Use the dropdown beside the toggle to choose between "component" encoding (encodeURIComponent — safe for query values; encodes :/?#&=) and "whole URL" encoding (encodeURI — preserves :/?#&= so the URL structure stays intact).

In decode mode, paste any percent-encoded text and the decoded version appears below. Decoding always uses the standard decodeURIComponent, which handles UTF-8 sequences correctly so emojis and non-Latin characters round-trip cleanly. If your input contains a stray %-sign or invalid hex pair, you'll see an error in red.

Frequently asked questions

  • What's the difference between encodeURI and encodeURIComponent?

    encodeURIComponent encodes every character that isn't a letter, digit, or one of -_.~!*'() — including :/?#&=, which are URL structural characters. encodeURI leaves those structural characters alone, on the assumption that you're passing in a whole URL and don't want them escaped. Use "component" for query values, "whole URL" for full addresses.

  • Why does a space encode to %20 sometimes and + other times?

    Both forms exist. RFC 3986 says spaces in URLs should be %20, and that's what this tool produces. The + form is a legacy convention specific to application/x-www-form-urlencoded form submissions; servers parsing form data are expected to convert + back to a space. For path and query parts of modern URLs, %20 is the safer choice.

  • Why does encodeURIComponent produce more characters than I expect for accented letters?

    Because the encoding works on UTF-8 bytes, and most non-ASCII characters take 2–4 bytes in UTF-8. So "é" becomes %C3%A9 (two bytes encoded), and an emoji becomes four percent-encoded bytes like %F0%9F%98%80. That's the universal escape required to fit any Unicode character into URL-safe ASCII.

  • Is URL-encoding the same as Base64?

    No. URL-encoding only escapes characters that have special meaning in URLs, leaving plain letters and digits alone — so encoded URLs remain mostly readable. Base64 transforms arbitrary bytes into a fixed alphabet of A–Z, a–z, 0–9, +, /, producing output that looks nothing like the input. Different tools for different jobs.

More Text & Encoding tools