Skip to content
ToolboxHere home

URL encode

Encode a URL online, in your browser (urlencode in PHP terms): type a value or a whole address and get it percent-encoded the right way for where it is going: a query-string value, a full URL that keeps its separators, or form data with + for spaces. Decode and parse are one tap away.

  • Nothing you type leaves your device
  • 100% free
  • No sign-up
  • Instant results
URL EncodePercent-encode a value, a whole URL or form data, the difference explained; plus a URL parser with editable parameters.Starting… the tool runs entirely in your browser and needs JavaScript.

How to use URL Encode

  1. Paste the text: a search phrase, a file name, or a whole URL with spaces and non-Latin letters.
  2. Choose A value to encode everything but letters, digits and -_.~; A whole URL to keep : / ? # & =; Form data for + as space.
  3. Copy the encoded result from the right, or Swap to decode it back and check.
  4. Switch to Parse a URL to split an address into host, path and parameters, edit them, and rebuild it.

Why use URL Encode

Component or whole URL

The two modes developers mix up, side by side, so a slash is escaped when it should be and kept when it should not.

UTF-8 percent codes

Arabic, Urdu and emoji become their UTF-8 bytes (%D9%85…), as browsers send them.

Form data

application/x-www-form-urlencoded style with + for spaces, for POST bodies and older query strings.

Parse and rebuild

Protocol, host, port, path segments, a table of parameters you can edit, and the URL rebuilt from them.

About this tool

URLs can only carry a limited set of characters, so anything else, spaces, &, =, /, and every non-ASCII letter, is written as % and two hex digits of its UTF-8 bytes. The catch is which characters to encode: inside a query-string value every reserved character must be escaped, but in a whole address the slashes and question marks are structure and must stay. Encoding the wrong way breaks links or lets a value leak into the next parameter.

This page offers both, plus the form-data variant browsers use for POSTed forms, where a space is +. The decoder reads all three and reports a malformed % sequence instead of throwing. The parser uses the browser's own URL parser, so what it shows is what a browser would see; edit the parameters and the rebuilt URL updates.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent (A value here) escapes every reserved character, for a single value. encodeURI (A whole URL) leaves : / ? # & = and a few others alone so the address keeps working. Never put a whole URL through the component encoder unless it is itself a parameter value.

Should a space be %20 or +?

%20 in paths and in most query strings; + only in form data (application/x-www-form-urlencoded), where servers turn it back into a space. When in doubt use %20.

How is Arabic or Urdu text encoded?

As the bytes of its UTF-8 form, each written %XX, which is what every browser sends. مسجد becomes %D9%85%D8%B3%D8%AC%D8%AF.

Can it decode a URL from a log?

Yes: paste it in Decode. Sequences that are not valid are left as they are and named, so a truncated line does not lose the rest.

Does the parser fetch the URL?

No. It only reads the text you paste; nothing is requested.

Related tools