HomeTech › URL Encode / Decode

URL Encoder / Decoder

Output
Input Characters
0
Output Characters
0
Show the math
Enter values to see the worked formula.

What Your Result Means

How This Calculator Works

URL encoding (percent-encoding) converts special characters into a safe format for use in URLs. The encoder replaces unsafe characters with a percent sign (%) followed by two hexadecimal digits representing the character's ASCII code. For example, a space becomes %20. The encodeURIComponent() function handles the encoding, while decodeURIComponent() reverses it. This is essential for query parameters, form data, and any user-provided text in URLs.

Quick Questions

What characters get encoded?

Special characters like spaces, punctuation, and non-ASCII characters. Safe characters like letters, digits, and a few symbols (- _ . ~) remain unchanged. All others become %XX codes.

What's the difference between encodeURI and encodeURIComponent?

encodeURIComponent is stricter and encodes more characters, suitable for query parameters and form data. encodeURI preserves URL structure characters like / and : so it's for full URLs.

When should I URL-encode?

When adding user input to URLs, especially in query parameters and form submissions. This prevents special characters from being misinterpreted as URL syntax.

Can I decode a full URL?

Use this tool for individual components. For full URLs, use decodeURI instead, which preserves URL syntax characters. This tool uses decodeURIComponent for segments.

What is percent-encoding?

The technical name for URL encoding. It's a standardized way to represent arbitrary bytes in URLs using only ASCII characters, defined in RFC 3986.

Sources

Method & review

MethodologyHow we calculate this Reviewed & Updated2026-04 Next review2027-04

Estimate only. Results reflect your inputs and standard formulas. Double-check important decisions independently.