URL Encoder and Decoder

Percent encode text for URLs and decode it back, RFC 3986.

Technology and NetUpdated 2026-10-111 min read
URL Encoder and Decoder
Any text to encode, or a %XX code to decode.
Result
...
Sizes...
Changed...

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

  1. Pick encode text or decode code.
  2. Type the text or paste the %XX code.
  3. Read the result first.
  4. Read sizes to see the growth.
  5. Copy the output into links or code.

Formula

Unreserved pass: A-Z a-z 0-9 - _ . ~. Else UTF-8 bytes as %XX uppercase.
%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.

  1. Letters pass: Jack and Jill stay.
  2. Spaces encode: two %20 triplets.
  3. Ampersand encodes: %26.
  4. Join: Jack%20%26%20Jill, 11 to 17 chars.
  5. Tool shows the code, sizes, 3 chars encoded.

Reference table

Common codes
CharCodeUse
space%20Separators
&%26Query values
=%3DQuery values
?%3FQuery values
/%2FPath 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.

Sources

How this page was checked. The formula above was matched against the cited sources, and the worked example was run through the tool on this page before publishing. If you spot an error, contact us so we can fix it and note the correction.