b2KIT

Percent Encoding Tool

Apply full percent-encoding (URI component) to strings with custom reserved character sets.

Tested tool guide Tested browser tools Checked August 16, 2026

What Percent Encoding Tool does, with a checked example

This tool percent-encodes a string for safe placement inside a URI, replacing every byte outside a chosen 'safe' set with %XX hex. By default it follows RFC 3986's unreserved set (letters, digits, - . _ ~) and escapes everything else, including space, +, /, and &. Users are often surprised that this differs from form encoding: spaces become %20 here, not +, and it will happily mangle a full URL's slashes and colons if you paste in more than a single component.

Worked example

A concrete input and expected output from the current implementation.

Input

café/menu?item=cost&price=5 5

Expected output

caf%C3%A9%2Fmenu%3Fitem%3Dcost%26price%3D5%205

é is UTF-8 encoded as bytes C3 A9 and each byte is percent-encoded; /, ?, =, &, and the space are outside the unreserved set so they are also escaped, leaving only letters, digits and the two literal '5' characters untouched.

How the result is produced

1

Unreserved-set encoding

Input is treated as text, converted to UTF-8 bytes, and each byte outside RFC 3986's unreserved set (A-Z, a-z, 0-9, hyphen, period, underscore, tilde) is replaced with a percent sign followed by two uppercase hex digits for that byte, so multi-byte characters like accented letters or emoji expand into several %XX groups.

2

Custom reserved characters

A field lets you list additional characters to leave unescaped, or to force-escape characters that would otherwise be left alone, before encoding runs. This is for building one specific URI component (a path segment versus a query value) where a sub-delimiter like ! or ' needs to stay literal for that particular API.

Good uses

  • Building a query-string value that itself contains &, =, or a space, so it does not get parsed as a separator when the URL is assembled
  • Encoding a path segment where a specific sub-delimiter (e.g. ! or ') must remain literal because a target API rejects it escaped, using the custom reserved-set field
  • Checking exactly which UTF-8 bytes a non-ASCII string (accented letters, CJK text, emoji) will produce when sent as part of a URL

Limits and checks

  • Running this over a complete URL, not just one component, will also escape the '://' and path slashes, breaking the URL rather than protecting it
  • Output uses + nowhere; a space always becomes %20. If the receiving system expects application/x-www-form-urlencoded style (+ for space), this output needs manual adjustment
  • A character left out of the custom reserved list is still encoded even if you expected it to pass through, since the tool only preserves characters you explicitly add

Common questions

Does this encode spaces as + like a web form does?

No. This performs RFC 3986 percent-encoding, so a space always becomes %20. Form encoding (application/x-www-form-urlencoded) uses + for spaces instead, so if that's what you need, replace the %20 sequences afterward or use a form-encoding tool.

Can I feed it a whole URL, like https://example.com/a b?x=1?

You can, but the result will not be a usable URL: the scheme separator '://' and the path slash will be escaped too. Encode only the piece that needs protecting, such as the query value or the 'a b' segment, and rebuild the URL yourself.

References and verification

The example and behavioral notes were checked against the browser implementation. Standards and primary references below define the relevant format, formula, or platform behavior.

Related Tools