Skip to content
Utilboxes

URL Encoder

Paste a URL or a value and choose the mode: full URL keeps structural characters such as / ? and & intact, while component mode escapes them for use inside a query parameter. Non-ASCII characters become UTF-8 escapes, so é is %C3%A9, and a space is %20, which is always safe. Nothing is uploaded.

Runs entirely in your browser

Updated

How to use the URL Encoder

  1. 1Paste the URL or the value you want to encode.
  2. 2Choose the mode: full URL, or a single component.
  3. 3Copy the encoded result.
  4. 4Switch to component mode if you are building a query string.

How it works

There are two different jobs here and using the wrong one is the classic URL bug. Encoding a full URL must leave the structural characters alone — the :// , the / between path segments, the ? and the & — or the URL stops being a URL. Encoding a single parameter value must escape those same characters, or a value containing & will be read as the start of another parameter.

So encoding https://example.com/a b as a full URL gives https://example.com/a%20b, with the slashes intact. Encoding the same string as a component escapes everything: https%3A%2F%2Fexample.com%2Fa%20b — which is exactly right when that URL is being passed as a redirect parameter.

Percent-encoding writes each disallowed byte as % followed by two hex digits. Non-ASCII characters are converted to UTF-8 first, so a single character can become several escapes: é becomes %C3%A9.

Spaces have two encodings. In a path a space is %20; in a query string, + is also accepted by most servers as a legacy convention. %20 is always safe.

Everything runs in this page. Nothing you paste is transmitted, logged or stored, which is what makes it safe to drop a production payload in here while you are debugging.

Tips and common mistakes

  • Use component mode for a single query parameter value; full-URL mode would leave & and = unescaped.
  • Encode values once. Encoding an already encoded string turns % into %25 and breaks it.
  • Use component mode when passing a whole URL as a parameter, such as a redirect address.
  • Use %20 for spaces when unsure; it is valid everywhere.

Frequently asked questions

What is the difference between the two modes?
Full-URL mode preserves the characters that give a URL its structure (: / ? & #). Component mode escapes them, which is what you need when a value is being embedded inside a query parameter.
Why did my URL parameter break?
Almost always because a value containing &, ? or = was not encoded as a component, so the server read it as the start of a new parameter.
Should a space be %20 or +?
%20 always works. The + form is a legacy convention accepted in query strings only, and it is wrong in a path.
Which characters need encoding?
Spaces, non-ASCII characters such as é, and characters with a special meaning in URLs — like &, =, ?, # and / — when they appear inside a value rather than as part of the URL's structure.
How do I put a URL inside another URL?
Encode the inner URL in component mode, then add it as the parameter value. Its slashes, colons and ampersands are all escaped so they are not read as part of the outer URL.
Is anything sent to a server?
No. Encoding runs in the page.

Guides