URL Encoder / Decoder
Developer Tools · By Sidhin · Added
Percent-encode text for safe use in a URL, or decode an encoded URL back into something readable. A component mode escapes everything reserved, a full-URI mode preserves the structural characters, and any query string can be split into a table of parameters.
How to use the url encoder / decoder
- 1Choose Encode or Decode.
- 2Pick component mode for a single value, or full-URI mode for a whole address.
- 3Paste your text and read the result.
- 4Paste a full URL into the parser to see each query parameter separately.
Examples
Encoding a search term
- Input
- coffee & cake
- Result
- coffee%20%26%20cake
Parsing a query string
- Input
- https://example.com/s?q=tea+bags&page=2
- Result
- q = tea bags · page = 2
About the url encoder / decoder
Which characters actually need encoding
Unreserved characters — letters, digits, hyphen, full stop, underscore and tilde — are always safe. Reserved characters have structural meaning and must be escaped when they appear inside a value rather than as part of the URL's grammar. Everything else, including spaces and all non-ASCII text, has to be encoded.
Non-ASCII characters are encoded as their UTF-8 bytes, each written as a percent escape. This is why a single accented letter becomes two escape sequences and a CJK character becomes three.
Encode once, at the right layer
Build URLs with a proper API — URL and URLSearchParams in JavaScript, the equivalent in any other language — rather than by concatenating strings. Those APIs encode each part correctly and exactly once.
Manual string building is where double-encoding is born: a value gets escaped when it is stored, escaped again when the URL is assembled, and arrives at the server with a %2520 in it that nobody can explain.
Frequently asked questions
What is the difference between component and full-URI encoding?
Is a plus sign a space?
Why do I sometimes see %2520?
Related tools
Base64 Encoder / Decoder
Developer Tools
Encode text to Base64 and decode it back, with full Unicode and URL-safe support.
HTML Entity Encoder & Decoder
Developer Tools
Escape HTML characters to entities and decode them back, in named, decimal or hex form.
Regex Tester
Developer Tools
Test regular expressions live with highlighted matches, capture groups and replace.
ASCII Table
Developer Tools
Searchable ASCII reference with decimal, hex, octal, binary and escapes.