EditSafely

URL-encode a String

Percent-escape a string so it's safe to use in a URL.

Runs on your device, nothing uploaded

Encoding
Whole URL keeps : / ? & = # so the link still works.
Try:

0 chars · 0 lines

Output

Percent-escape a string so it's safe to use in a URL.

Type or paste above to see the result here.

Example: Escape a query value

What you paste never leaves this tab

URL-encode a String is JavaScript that your browser has already downloaded, and it does the whole job on your own machine. On a normal site, the text you paste is sent to a server that can log it, cache it or keep it. Here it is read and transformed inside this tab and nowhere else.

  • No upload
  • No length limit
  • Works offline once loaded
  • Nothing stored or logged

How to use URL-encode a String

  1. 1. Paste the string. Enter the text you need to embed in a URL into the input pane, including any spaces, ampersands, or special characters that would otherwise break the link.
  2. 2. Choose what to encode. Pick Query value for a single parameter, Whole URL to keep : / ? & = # so a link still works, or Strict RFC 3986, which also encodes ! ' ( ) *. Encode spaces as + suits form-style query strings, and Each line separately encodes a list of values.
  3. 3. Copy the encoded string. Copy the percent-escaped result out of the output pane and drop it directly into a URL query parameter or form submission where raw special characters are not allowed.

When to use URL-encode a String

URL-encode a String percent-escapes characters that are unsafe to use directly inside a URL, such as spaces, ampersands, and equals signs. Use it whenever you are building a link or query string by hand and need a value embedded safely.

  • Building a query string parameter by hand. You are constructing a link with a search term or filter value as a query parameter, and the value contains spaces or an ampersand that would otherwise break the URL structure.
  • Encoding a value for a share link. You want to generate a shareable URL that includes a title or message as a parameter, and encoding it first prevents special characters from corrupting the link.
  • Passing a file name with special characters in a URL. A file name includes spaces or symbols and needs to be referenced in a URL path or query parameter, and encoding it keeps the link valid across browsers and servers.
  • Preparing a redirect target for a query parameter. You are building a redirect link where the destination URL itself needs to be passed as a query value, and encoding it prevents its own slashes and equals signs from breaking the outer URL.

Examples

Escape a query value

Input

a b&c=d

Output

a%20b%26c%3Dd

Keep a URL working

Input

https://example.com/a b?q=x y&n=1

Output

https://example.com/a%20b?q=x%20y&n=1

About the URL-encode a String tool

URL-encode a String is a free online tool that works entirely inside your web browser. Percent-escape a string so it's safe to use in a URL. Because the processing happens on your own device, nothing you enter is uploaded, logged or stored anywhere.

This page is one of 159 String utilities on EditSafely. Each one does a single job well, and all of them follow the same rule: your input stays on your machine.

You can shape the output with 3 settings, including Encoding, Encode spaces as + and Each line separately, and the result refreshes the moment you change one. 2 worked examples further down the page show exactly what the tool produces for real inputs.

Because nothing leaves your device, the tool is suitable for sensitive content such as internal documents, credentials or customer data. It also responds instantly, since every step is handled on your own machine rather than by a remote API.

Frequently asked questions

Is URL-encode a String free to use?

Yes, it is completely free. All 2,943 tools on EditSafely work without an account, a subscription or usage limits.

Is it safe to paste sensitive or confidential data?

Everything happens locally. Your browser downloads the tool's code once, then does all the processing itself; nothing you enter is transmitted, stored or logged. You can even go offline after the page loads and it will still work.

How much text can I process at once?

There is no fixed limit; your device's memory is the ceiling. Up to 10 MB the result updates as you type, after a short pause that grows with the size. Above 10 MB a Run button appears so typing stays smooth, and files open up to 50 MB. A very long result shows its first 2,000 lines on screen, while Copy and Download always include all of it.

Do I need to sign up or install anything?

No. The tool works in any modern browser on desktop, tablet or phone. There is no account to create, no extension to add and no software to install.

How do I use the result?

The output panel has a one-click copy button, and you can keep refining the input while you work; the result updates in place as you type.