SYSTEM TIME --:--:-- IST · 166 TOOLS LIVE · RUNS IN YOUR BROWSER — NOTHING UPLOADED
← Back to DEVELOPER
DEVELOPER

URL Encode

Percent-encode text or a URL value.

About this tool

URL encoding (percent-encoding) replaces characters that are not safe inside a URL — spaces, ampersands, question marks, non-ASCII characters — with a % followed by their hex code, so the URL can be transmitted without ambiguity.

This is essential when you are building a query string by hand and a value might contain characters that would otherwise break the URL structure, such as an "&" inside a search term or a space in a file name. Decoding reverses the process, turning a percent-encoded string back into readable text.

Worked example: "hello world & more" encodes to "hello%20world%20%26%20more". Each unsafe character is replaced by a percent sign followed by its hex byte value: a space becomes %20 (32 in hex is 20), and "&" becomes %26 (38 in hex is 26) — the ampersand specifically has to be encoded here because it's the character that separates parameters in a query string, so a literal "&" inside a value would be misread as the start of a new parameter rather than part of the value itself.

The tool uses JavaScript’s encodeURIComponent and decodeURIComponent, which encode a broader set of characters than encodeURI — the right choice for individual query parameter values rather than a full URL.

Frequently asked questions

What is the difference between encodeURI and encodeURIComponent?

encodeURIComponent escapes more characters and is meant for individual values (like a query parameter), while encodeURI is meant for a full URL and leaves characters like / and : untouched. This tool uses encodeURIComponent.

Why do spaces become %20 or +?

%20 is standard percent-encoding for a space. A + is a separate convention used specifically inside application/x-www-form-urlencoded query strings — this tool outputs %20.

Can I encode an entire URL including https://?

You can, but encodeURIComponent will also escape the slashes and colon, breaking the URL structure. Encode only the value you are inserting into a query string, not the whole URL.

Other URL Encoder / Decoder scenarios

Related tools