Developer

URL Encoder / Decoder

Encode or decode URLs and query components instantly and privately in your browser.

  • Free forever
  • No sign-up
  • Runs in your browser
Share X LinkedIn
encodeURIComponent — escapes / ? & = # too

Text to encode

Result

What is URL encoding?

URL encoding — also called percent-encoding — rewrites characters that are unsafe or reserved in a web address as a % followed by their hexadecimal byte value. A space becomes %20, an ampersand becomes %26, and a German ü becomes %C3%BC. URLs can only safely carry a limited set of characters, so anything outside that set has to be escaped before it can travel inside a link.

This matters the moment you put real-world text into a URL. A search term with spaces, a name with an accent, a redirect target that itself contains ? and =, or any value from a form — all of them can break a link or be misread by the server unless they are encoded first. Percent-encoding is the standard, language-agnostic way to make any text URL-safe.

How to use it

  1. Choose Encode or Decode at the top.
  2. Pick Component for a single query value, or Full URL for a whole address.
  3. Paste your text into the input box.
  4. The result appears instantly in the box below.
  5. Press Copy to grab it, or Clear to start again.

Encoding accepts any text, including emojis and accented characters, because it works on the UTF-8 bytes — the same byte-level approach the Base64 Encoder / Decoder uses when you need to pack binary data into text. Decoding expects valid percent-escapes — if it finds a broken one, you get a clear message instead of corrupted output.

Component vs Full URL — which one?

The two modes map directly to the JavaScript functions browsers ship:

  • Component (encodeURIComponent) escapes the structural characters too — /, ?, &, =, # and more. Use it for a single piece of a URL: one query parameter value, a path segment, or a fragment. This is the mode you want most of the time.
  • Full URL (encodeURI) leaves the structural characters intact so the address still works. Use it to clean up a whole link that has spaces or accented characters but whose https://, slashes and query separators must be preserved.

A quick rule of thumb: if the text you are encoding will become one value inside a larger URL, use Component. If the text is the URL, use Full URL.

When you would use URL encoding

  • Query parameters — putting a search term, email, or any free text into ?q=… so spaces and symbols do not break the request.
  • Redirect targets — embedding one URL inside another, like ?next=…, where the inner address must be fully escaped.
  • API requests — building safe query strings by hand when you are testing an endpoint or writing a quick script.
  • Sharing links — fixing a pasted address that arrived with raw spaces or non-Latin characters and will not open.
  • Debugging — decoding a long encoded string to read what a parameter actually contains.

Common mistakes and tips

  • Don't double-encode. Encoding text that is already encoded turns %20 into %2520 and breaks it. If you are unsure, decode first and check what you have.
  • + is not a space here. encodeURIComponent writes spaces as %20, and decoding does not convert + to a space. Legacy form data that uses + needs a manual replace first.
  • Pick the right scope. Encoding a whole URL with Component will escape the :// and the ?, leaving a string that is no longer a working link. That is correct only when the URL is meant to be a value inside another URL.
  • Watch for reserved characters in values. A query value that contains & or = must be Component-encoded, otherwise the server will read it as the start of a new parameter.
  • Round-trip to verify. Encode, then switch to Decode and paste the result back — you should get your original text. This is a fast way to confirm a tricky value survived intact.

Because everything runs locally in your browser, this encoder/decoder is a quick, private helper to keep in a tab whenever you are building query strings, debugging links, or cleaning up addresses that refuse to open. For the related job of fingerprinting a value rather than escaping it, the Hash Generator produces checksums and digests in the same private way.

Frequently asked questions

Comet's got your back

Stuck on something? Every tool has a short guide and FAQ — and Comet can point you to the right spot.

Visit help centre