LocalExcelTool
Get started

URL Encode

Percent-encode text for safe use in URLs.

Runs in your browserNo account neededFree

What is URL Encode

URL encoding (percent encoding) converts characters that cannot appear in a URL into a %XX format.

🔒 Everything runs in your browser. Nothing is uploaded.

What this tool actually does with your file

Where it runs
In your browser, on this page
Upload
None — the file never leaves your device
Offline
Works with the network disconnected

Two different jobs, two different functions

Percent-encoding has two legitimate scopes in JavaScript and mixing them is the number one URL bug. encodeURIComponent escapes everything except A–Z a–z 0–9 - _ . ! ~ * ' ( ), which makes it right for a single parameter value. encodeURI leaves : / ? & = # alone, which makes it right for a whole URL you are only cleaning up.

Wrap an entire URL in encodeURIComponent and https://example.com/a?b=1 becomes https%3A%2F%2Fexample.com%2Fa%3Fb%3D1 — a single opaque path segment that no server will route. Encode only a value with encodeURI and an & inside that value survives, splitting one parameter into two on the receiving end.

Non-ASCII is bytes first, percent signs second

Characters outside ASCII are encoded as UTF-8 bytes, and each byte becomes its own %XX. A single Chinese character is three bytes and therefore three escape sequences, so the encoded form is nine characters long. An emoji is four bytes and becomes twelve characters. That multiplication is why URLs carrying CJK slugs look enormous in logs.

Spaces become %20 here rather than +. Both are read as a space by form parsers, but only + is specific to the form-encoding convention; %20 is legal in every URL context including the path, and it is the only one that survives a path segment intact.

What to leave unencoded on purpose

Encoding is not sanitisation. Percent-encoding a value does not make it safe for SQL, HTML or a shell — those layers have their own escaping rules, and a string that is perfectly valid percent-encoding can still be a directory traversal once the server decodes it. Decode-then-validate is the order that matters.

Also expect the output to differ from what other tools show for the same input. Libraries disagree on whether ~ * ' ( ) and ! need escaping; some legacy encoders also emit ! as %21. Both forms decode identically, so never compare encoded strings for equality to test whether two values are the same value.

How to use it

  1. 1.Enter text
  2. 2.Get encoded output
  3. 3.Use it in a URL

How URL Encode works under the hood

Encoding tools convert between representations of the same bytes: Base64, percent-encoding, hex, HTML entities, Unicode escapes. A correct encoder is reversible; a lossy one silently changes the data.

  1. 1

    Get the exact bytes

    Text is encoded to UTF-8 bytes with TextEncoder first; binary input is read as an ArrayBuffer. Encoding the wrong byte sequence is the most common cause of a wrong result.

  2. 2

    Apply the encoding rule

    Each format has an exact specification: Base64 uses a 64-symbol alphabet with padding, percent-encoding escapes reserved characters as UTF-8 bytes.

  3. 3

    Decode back to verify

    Round-tripping the output back to the input is the only honest proof that an encoder is correct. The tool keeps the reverse path available on the same page.

  4. Processing pipeline

Base64 is not encryption

Base64 increases size by about a third and hides nothing: anyone can decode it. It exists to carry binary data through text-only channels such as JSON, email headers and data URLs. If you need confidentiality, use encryption with a key, not an encoding.

Where encoders break

Percent-encoding applied twice turns %20 into %2520; Base64 without padding fails strict decoders; UTF-16 input decoded as UTF-8 produces replacement characters that cannot be recovered. When output looks wrong, check the byte sequence before checking the tool.

Verify it yourself

Encoders are pure functions over bytes. Decode the output again and you should get the input back exactly.

  1. 1.Open DevTools on this page and switch to the Network tab
  2. 2.Keep the filter on Fetch/XHR and run the tool
  3. 3.Confirm no request carries your file — you should see only page assets and fonts

Frequently asked questions

Why encode a URL?

To safely handle characters like spaces and non-ASCII text in URLs.

Can I decode?

Yes, use the companion URL decode tool.

What this kind of conversion cannot keep

Encoding and hashing run through the browser's Web Crypto API or a pure-JavaScript implementation. The output is deterministic: the same input always produces the same digest, so you can verify a result against any other tool.

More in Encoding