Developer Tools

URL Encoder & Decoder

Encode and decode URLs and query parameters using standard percent-encoding.

Percent-Encoded Result
Runs 100% locally in your browser. Zero data transmission.

How It Works & Underlying Concept

URL encoding (also known as percent-encoding) converts reserved and non-ASCII characters into valid URL characters using a percent sign followed by two hexadecimal digits. This ensures that parameters containing spaces, ampersands, or slashes do not break web query strings.

Mathematical Formula / RuleReplaces unsafe bytes with '%' followed by two hexadecimal digits (e.g. space becomes '%20').
Quick Instructions
1Enter your URL or parameter string.
2Choose 'Encode' to escape special characters, or 'Decode' to make an encoded URL human-readable.
3Copy the result.

Key Capabilities

  • Supports encodeURIComponent (for query strings) and encodeURI (for full URLs)
  • Decodes percent-encoded URLs back to readable Unicode text
  • Instant copy and clear controls
Real-World Example

Query Parameter Encoding

A developer wants to pass the search phrase 'cats & dogs?' as an HTTP query parameter.

Step 1:Enter 'cats & dogs?' into the encoder.
Step 2:Click 'Encode URL Component'.
Result: Converts to 'cats%20%26%20dogs%3F', ensuring the '&' and '?' do not interfere with URL query parsing.
Technical Notes & Limits
  • Malformed percent-encoded sequences (such as an isolated '%' without two hex digits) will report a decoding error.

Frequently Asked Questions

What is the difference between encodeURI and encodeURIComponent?▾
encodeURI preserves protocol characters like 'https://' and '?' for full URLs, while encodeURIComponent escapes everything including slashes, colons, and ampersands for query parameter values.

Related Developer Tools

View all Developer Tools