Encoding Mode

encodeURIComponent — encodes all special characters including :, /, ?, #, &, =. Use for query parameter values.

Direction
0 chars
0 chars

Questions

Frequently asked questions

What is URL encoding?

URL encoding (percent-encoding) replaces unsafe or reserved characters with a percent sign followed by two hex digits. For example, a space becomes %20 and an ampersand becomes %26.

What's the difference between encodeURI and encodeURIComponent?

encodeURI preserves characters that are part of URL structure — colons, slashes, question marks, hashes, and ampersands. encodeURIComponent encodes everything except unreserved characters (letters, digits, -, _, ., ~). Use encodeURIComponent for query parameter values and encodeURI for complete URLs.

When should I URL-encode text?

Anytime you put user input into a URL — query parameters, path segments, or fragment identifiers. Without encoding, special characters like & or = can break the URL structure or cause security issues.

Is my data sent to a server?

No. All encoding and decoding happens in your browser using native JavaScript APIs. Nothing is transmitted over the network.

Why does decoding sometimes fail?

Decoding fails when the input contains invalid percent-encoded sequences like %ZZ (Z is not a valid hex digit). Valid percent-encoding uses only digits 0-9 and letters A-F after the percent sign.