Secrets and encoding

How to URL-encode a query string

Encode each query parameter value separately so reserved characters cannot accidentally become query separators. PageUtil URL Encoder uses component encoding for text such as spaces, ampersands and non-ASCII characters. Build the URL from the encoded values rather than encoding an already assembled URL as one component.

URL encoding, percent-decoding, and HTML escaping are different jobs.
URL encoding is for a query component, and a whole URL is the wrong thing to encode.

What to run

Open URL Encoder. It stays in the browser.

How to read the result

This tool uses encodeURIComponent: a space becomes %20 and a literal plus becomes %2B. Its decodeURIComponent operation leaves a raw plus unchanged.

Encode a component, not a whole URL, or you will escape ://.

The decoded form should match the input.

What to open next

Open HTML Escape only if the same string is also going into HTML. They are different encodings. It stays in the browser.

References

Related tools

Frequently asked questions

Should I encode an entire URL?

No. A whole URL is the wrong thing to encode. Encode a component, not a whole URL, or you will escape ://.

How does URL Encoder handle spaces?

This tool uses encodeURIComponent: a space becomes %20 and a literal plus becomes %2B. Its decodeURIComponent operation leaves a raw plus unchanged. URL Encoder stays in the browser.

Is URL encoding the same job as HTML escaping?

No. They are different encodings. Open HTML Escape only if the same string is also going into HTML.

Need help with a tool or found a bug?

Report an issue directly to engineering. No accounts required — all client data remains private on your device.

Report an Issue →