URL Encoder and Decoder
Percent encode text for URLs and decode it back, RFC 3986.
What it does
Links break the moment raw spaces and ampersands ride inside them, because servers read those marks as structure. Percent encoding swaps each unsafe byte for a %XX triplet, so Jack & Jill travels as Jack%20%26%20Jill and arrives intact. The tool above encodes and decodes to RFC 3986 with sizes shown.
The default encodes the classic form field trap: an ampersand inside a name would split server fields without encoding. Eleven characters grow to seventeen with three triplets, while letters and digits pass untouched. Decoding reverses the trip byte first, text second.
Two references define the behavior. RFC 3986 reserves the percent mechanism with unreserved letters, digits, hyphen, period, underscore, and tilde passing through, and MDN documents the matching encode routine that escapes everything else including !, quotes, parens, and star. Uppercase hex digits keep output canonical.
Component encoding differs from full URL encoding on purpose. This page encodes every reserved mark, which suits query values and path segments; whole addresses with scheme and slashes intact need lighter treatment that this converter deliberately skips.
How to use
- Pick encode text or decode code.
- Type the text or paste the %XX code.
- Read the result first.
- Read sizes to see the growth.
- Copy the output into links or code.
Formula
- %XX
- Two uppercase hex digits per byte.
- UTF-8
- Non-ASCII becomes multi byte triplets.
- unreserved
- Characters that never encode.
RFC 3986 component style: reserved marks always encode here. Decoding malformed triplets errors instead of guessing.
Worked example
Example: Jack & Jill
Default: encode, Jack & Jill.
- Letters pass: Jack and Jill stay.
- Spaces encode: two %20 triplets.
- Ampersand encodes: %26.
- Join: Jack%20%26%20Jill, 11 to 17 chars.
- Tool shows the code, sizes, 3 chars encoded.
Reference table
| Char | Code | Use |
|---|---|---|
| space | %20 | Separators |
| & | %26 | Query values |
| = | %3D | Query values |
| ? | %3F | Query values |
| / | %2F | Path segments |
Limits
- Component style; whole URLs need lighter encoding.
- UTF-8 assumed for non-ASCII bytes.
- + stays literal; forms may want plus for space.
- Double encoding corrupts; decode once.
Common mistakes
- Encoding whole URLs and breaking ://.
- Decoding twice and mangling percents.
- Using + for space outside forms.
- Forgetting non-ASCII grows multi byte.
- Trusting malformed %XX pairs.
Try it yourself
Quick checks. Answers sit tucked under each question.
Encode a+b=c?
a%2Bb%3Dc, 5 to 9 chars, 2 encoded.
Decode a%2Bb%3Dc?
Back to a+b=c.
Decode %ZZ?
Error: bad percent code found.
Questions
Jack & Jill encoded?
Jack%20%26%20Jill.
Why encode &?
Servers split fields on raw ampersands.
What passes through?
Letters, digits, hyphen, underscore, period, tilde.
Upper or lowercase hex?
Uppercase canonical: %2B not %2b.
Encode whole links?
No. That breaks scheme and slashes.
Non-English text?
UTF-8 bytes each ride as %XX triplets.